Working with money is a bit problematic, if you use a language, that supports floats defined by
double-precision 64-bit binary format IEEE 754 which is used in
javascript. The build in js math library has a function:
Number.isSafeInteger()
to check if a number can be safely stored. ....
The following example is a systemic problem, and shouldn't be blamed on the mathcell project.
- open
http://mathcell.tiddlyspot.com/#Excel%20Like%20Table - enter: 0.1 into B1
- enter: 0.2 into B2
- C1 should show: 0.02 ... but it shows
0.020000000000000004
- B3 should show 0.3 (B1 + B2) ... but it doesn't
That's not really, what you expect. right?
So, to deal with currencies, we'd need to use libraries, that are able to deal with rules, that we use for currencies. ...
| eg: In Austria we use 0,1 instead of 0.1 ... and so on ...
have fun! mario
|