openexchangerates / accounting.js

A lightweight JavaScript library for number, money and currency formatting - fully localisable, zero dependencies.
http://openexchangerates.github.io/accounting.js
MIT License
4.96k stars 530 forks source link

formatMoney preserve original precision #216

Open jayshah123 opened 4 years ago

jayshah123 commented 4 years ago

Passing any amount to formatMoney will default the precision to 2 decimal places.

Request adding option to preserve original precision. e.g. formatMoney(1234.423543) should be $1234.423543 and formatMoney(1234.234) should be $1234.234

Or atleast provide some config option to preserve original precision.