This doesn't appear to address any of the numerical issues with representing money in floating-point numbers. I assume it's just meant for client-side previews and estimates?
If you're doing accurate conversions on the server side, I guess I don't see the advantage to doing different conversions that yield different results on the client side.
It's true that representing currency in floating-point vars is never going to be 100% accurate - but for price quotations, estimates and convenience, you can get pretty accurate results (provided you have accurate exchange rates)
Remember of course that any currency conversion will always carry inaccuracy, because every time money changes currency, somebody takes a cut.
I recommend using this alongside some other numbers-related library (such as accounting.js) to fix binary value rounding issues (and also for decent formatting)
Out of interest, what do you consider to be "accurate conversions on the server side"?
If I had to do accurate calculations from scratch, I would probably used fixed-point or arbitrary-precision math, talk to an accountant about industry standards and carefully cover my edge-cases for rounding and the like. More practically I would try to use a well-established library. I can't recommend anything specifically.
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.
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.
If you're doing accurate conversions on the server side, I guess I don't see the advantage to doing different conversions that yield different results on the client side.