Re:Money.js is a tiny (1kb) JavaScript currency conversion l...
by josscrowcroft on Friday October 14, 2011 @10:57AM
(#3111409)
Fair play. I definitely wouldn't feel good recommending money.js for any application where people live and die by the 8th point of precision on an exchange rate, if you know what I mean - but it's a solid solution for estimates, price conversions and most enterprise software - provided that appropriate disclaimers are given (i.e. "converted prices for informational purposes only") - everyone should cover their arses.
I agree with you though, that there will be the 1% of cases where something a lot more reliable is needed, but I imagine that's when you call in the CS heavyweights.
It's not impossible to do accurate calculations in JS, but my main point is that since the only built-in way to do math is floating point it's a bit of a minefield to go with a naive solution.