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.95k stars 528 forks source link

Incorrect parsing numbers with E (123.34E+15) #207

Open acherkashin opened 4 years ago

acherkashin commented 4 years ago

I have the problem with following code

accounting.format("1,23E+4", 1, ",", " "); // returns "1,234 0"

It seems accounting.js just removes E+ from the string and after that converts to a string.

What I am expecting, it should return: 12 300