currency.js
currency.js copied to clipboard
Handle max/min integer values
Currently, currency.js does not handle integer values beyond the max/min possible int values. So for whatever reason if you're performing calculations in that range you could have some overflow errors.
The maximum possible value should be 253 - 1 or 9,007,199,254,740,991. There should probably be some tests around this, and the library could potentially throw an error if that number overflows. There's some additional functions available as part of the ES6 harmony draft that might be available to be used.
I wouldn't worry about this one -- if people use numbers that big they are in for all kinds of problems -- this is not your problem -- not worth the effort or complexity -- just say that "behaviour is undefined" in these circumstances ;)
Could use bigint internally to get around this problem.