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

When input to FormatMoney is negative and very close to zero, rounding gives -0.00. Need config to get 0.00 without sign #174

Open sandhiyarajaraman opened 7 years ago

sandhiyarajaraman commented 7 years ago

accounting.formatMoney(-0.000089); // gives "$-0.00"

If I want to remove the -ve sign and only retain 0.00, I am not able to do so with accounting.js

There should be a setting which makes us remove minus sign when value is zero (based on our preference) I have a requirement where -0.0008 rounded with formatMoney must give $0.00 WITHOUT a negative sign. Not $-0.00