bignumber.js is a JavaScript library for arbitrary-precision decimal and non-decimal arithmetic. Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal. 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. See also decimal.js, which among other things adds support for non-integer powers, and performs all operations to a specified number of significant digits.

Features

  • Integers and decimals
  • Simple API but full-featured
  • 8 KB minified and gzipped
  • No dependencies
  • Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only
  • Comprehensive documentation and test set

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow bignumber.js

bignumber.js Web Site

Other Useful Business Software
Go From AI Idea to AI App Fast Icon
Go From AI Idea to AI App Fast

One platform to build, fine-tune, and deploy ML models. No MLOps team required.

Access Gemini 3 and 200+ models. Build chatbots, agents, or custom models with built-in monitoring and scaling.
Try Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of bignumber.js!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Mathematics Software, JavaScript Libraries

Registered

2021-11-29