JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 8947280
  • Score
    100M100P100Q224747F
  • License MIT

An arbitrary-precision Decimal type for JavaScript.

Package Exports

  • decimal.js-light

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (decimal.js-light) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

decimal.js-light

The light version of decimal.js, an arbitrary-precision Decimal type for JavaScript.


[![Build Status](https://travis-ci.org/MikeMcl/decimal.js-light.svg)](https://travis-ci.org/MikeMcl/decimal.js-light)

The API is a subset of the API of decimal.js.

API

Size of decimal.js-light minified: 13.3 KB.
Size of decimal.js minified: 32.1 KB.

Other differences are that this library does not include NaN, Infinity or -0 as legitimate values, or work with values in other bases.

Also, here, the Decimal.round property is just the default rounding mode for round, toDecimalPlaces, toExponential, toFixed, toPrecision and toSignificantDigits. It does not apply to arithmetic operations, which are simply truncated at the required precision.

Further, the exp, ln, log, and pow methods have a limited precision of around 400 digits (which can be increased by adding further digits to the value of LN10 in the source code.)