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

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
Start 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