Hacker News new | ask | show | jobs
by chill1 2978 days ago
It looks like the linked library expects you to provide integer values only. You can do the same with cryptocurrencies (satoshis in the case of Bitcoin), but not all cryptocurrencies have the same number of decimal places (Monero with 12 instead of 8).

I've used the following library in the past:

* https://mikemcl.github.io/bignumber.js/

It's also worth noting that the maximum integer value that can be safely stored by the Number type in JavaScript is 2^53 (9007199254740992). So if you expect to be working with integers larger than this, you should use a library for working with large integers (private keys in cryptocurrencies). The one linked above works, but there are others as well.