4 ms·
This looks nice. One thing though - you should consider using strings instead of numbers for the amounts. The problem is that numbers in JS are actually floats,
by gabipurcaru 9y ago
This looks nice. One thing though - you should consider using strings instead of numbers for the amounts. The problem is that numbers in JS are actually floats, and you lose precision on high values. Probably not going to make a big difference, but e.g. 100000000000000001 can't be represented as a number in JS.
- VMG 9y ago> consider using strings And because '1' + '1' === '11' is not the pinnacle of arithmetic either, consider using bignumber.js or a better language than JavaScript
- hakanito 9y agoSo, what other language do you suggest for building an interactive web app?
- vertoc 9y agoAh good call - I will definitely be switching to either strings or, as another commenter pointed out, BigNumber. Thanks for catching this!