Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 27, 2024 via pnpm

bignumber.js 9.1.2

A library for arbitrary-precision decimal and non-decimal arithmetic
Package summary
Share
0
issues
1
license
1
MIT
Package created
26 Nov 2012
Version published
28 Aug 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
bignumber.js@9.1.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of bignumber.js 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does bignumber.js do?

bignumber.js is an efficient JavaScript library designed to execute arbitrary-precision decimal and non-decimal arithmetic operations. With a simple and robust API, it enables faster, smaller and more straightforward arithmetic calculations compared to the Java's BigDecimal JavaScript versions. This library comes with a variety of features, including the replication of JavaScript's toExponential, toFixed, toPrecision, and toString methods, and a new toFraction and a correctly-rounded squareRoot method. It is designed to offer wide platform compatibility, utilizing JavaScript 1.5 (ECMAScript 3) features, and it does not depend on any other libraries.

How do you use bignumber.js?

The bignumber.js library is easy to use and you can start by installing it in Node.js using the command npm install bignumber.js. Once installed, you can require or import the library into your code file:

const BigNumber = require('bignumber.js');
// or
import BigNumber from "bignumber.js";

You can now perform operations using the BigNumber constructor function. For example:

let x = new BigNumber(123.4567);
let y = BigNumber('123456.7e-3');

To get a BigNumber value as a string, you can use toString() or toFixed() methods:

let x = new BigNumber('1111222233334444555566');
console.log(x.toString());    // "1.111222233334444555566e+21"
console.log(x.toFixed());     // "1111222233334444555566"

The API also supports chaining to execute multiple operations in one go:

x.dividedBy(y).plus(z).times(9)

Where are the bignumber.js docs?

The bignumber.js library provides comprehensive and detailed documentation, which can be found here. The documentation offers a useful guide to users on how to use and optimize the functionality of the library effectively. It includes detailed sections on BigNumber.js's methods, properties, configuration, and even performance notes. Furthermore, the documentation site provides examples, API reference, and information about certain intricate details for advanced use-case scenarios.