bignumber.js
A JavaScript library for arbitrary-precision decimal arithmetic
...Replicates the toExponential, toFixed, toPrecision and toString methods of JavaScript's Number type. Includes a toFraction and a correctly-rounded squareRoot method. Supports cryptographically secure pseudo-random number generation. Wide platform compatibility, uses JavaScript 1.5 (ECMAScript 3) features only. If a smaller and simpler library is required see big.js. It's less than half the size but only works with decimal numbers and only has half the methods. It also has fewer configuration options than this library, and does not allow NaN or Infinity. ...