osrec / currencyFormatter.js

A super simple currency formatting library
MIT License
635 stars 61 forks source link

Rounding Off Issue #27

Closed sanyamagrawal closed 6 years ago

sanyamagrawal commented 6 years ago

Is there a reason for the library to convert OSREC.CurrencyFormatter.format(0.999, { currency: 'EUR'})

shows "1,00 €"

Is there a reason for this rounding off, and also is there a way to avoid this rounding off ?

osrec commented 6 years ago

I think it's doing the right thing. What would you expect this to show?

If you want to avoid the rounding off, just use value.toFixed(2) on your number before passing it to the format function.