iost.js
iost.js copied to clipboard
Use `Math.trunc` instead of `parseInt`.
In some cases, parseInt()
will return unexpected values.
parseInt(0.000001)
0
parseInt(0.00000001)
1
Math.trunc()
is safer.
Note: As you might know, Math.trunc()
isn't supported by some ancient Web browsers.
IMO, they are no value to support. But if you don't suppose so, it will be required to add some configuration to Babel (polyfill).