big.js.safedeprecated

big.js but blows up for unsafe integers

Usage no npm install needed!

<script type="module">
  import bigJsSafe from 'https://cdn.skypack.dev/big.js.safe';
</script>

README

big.js.safe

big.js but blows up for unsafe integers

npm i --save big.js.safe

const Big = require('big.js.safe')
// your big.js code goes here

Why this module?

When passing a number to big.js this happens:

Big('1234567890123456789').toFixed()  // 1234567890123456789 - All OK
Big(1234567890123456789).toFixed()    // 1234567890123456800 - Precision lost

Here precision is lost without warning.

big.js.safe solves this by simply throwing an error when an unsafe integer is given.

No other modifications are made.