decimal.js is an arbitrary-precision Decimal type for JavaScript.
Features
- Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal
- Simple API but full-featured
- Replicates the
toExponential
, toFixed
, toPrecision
and toString
methods of JavaScript's Number type - Includes a
toFraction
and correctly-rounded exp
, ln
, log
and sqrt
functions - Supports non-integer powers
- Works with numbers with or without fraction digits in bases from 2 to 64 inclusive
- Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only