osrec/currencyFormatter.js

Parsing force toFixed 2 decimals

Closed this issue · 1 comments

cdiaz commented

For this case:

OSREC.CurrencyFormatter.parse('€ -99,50', { locale: 'it' });

The current behavior return:
-99.5
The expected behavior is:
Returns -99.50

Is there any way to do it?

osrec commented

Remember, the value returned is a numeric type, not a string. Therefore, you should use val.toFixed(2) on the returned value.