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

Tiny numbers lead to `NaN.undefined` #241

Open alexanderadam opened 5 months ago

alexanderadam commented 5 months ago

Something like this is likely not expected:

accounting.formatNumber(1e-7) // "NaN.undefined"
accounting.formatNumber(0.0000001)  // "NaN.undefined"