As their author, I recommend bignumber.js or big.js, 'a small, fast Javascript library for arbitrary-precision arithmetic with decimal numbers'.

For a more mature library, the ICU4J BigDecimal translation is also recommended.

Answer from MikeM on Stack Overflow
🌐
Mikemcl
mikemcl.github.io › decimal.js
decimal.js API
An arbitrary-precision Decimal type for JavaScript.
🌐
GitHub
github.com › MikeMcl › decimal.js-light
GitHub - MikeMcl/decimal.js-light: The light version of decimal.js, an arbitrary-precision Decimal type for JavaScript.
The light version of decimal.js, an arbitrary-precision Decimal type for JavaScript. - MikeMcl/decimal.js-light
Starred by 405 users
Forked by 49 users
Languages   JavaScript 99.8% | HTML 0.2%
🌐
npm
npmjs.com › package › decimal.js › v › 10.4.3
decimal.js - npm
An arbitrary-precision Decimal type for JavaScript.. Latest version: 10.6.0, last published: 8 months ago. Start using decimal.js in your project by running `npm i decimal.js`. There are 3688 other projects in the npm registry using decimal.js.
      » npm install decimal.js
    
Published   Jul 06, 2025
Version   10.4.3
Author   Michael Mclaughlin
🌐
GitHub
github.com › MikeMcl › decimal.js
GitHub - MikeMcl/decimal.js: An arbitrary-precision Decimal type for JavaScript · GitHub
The library is the single JavaScript file decimal.js or ES module decimal.mjs.
Author   MikeMcl
🌐
cdnjs
cdnjs.com › home › libraries › decimal.js › 9.0.0
decimal.js - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
An arbitrary-precision Decimal type for JavaScript. - Simple. Fast. Reliable. Content delivery at its finest. cdnjs is a free and open-source CDN service trusted by over 12.5% of all websites, serving over 200 billion requests each month, powered by Cloudflare.
🌐
GitHub
github.com › MikeMcl › decimal.js › blob › master › decimal.d.ts
decimal.js/decimal.d.ts at master · MikeMcl/decimal.js
An arbitrary-precision Decimal type for JavaScript - decimal.js/decimal.d.ts at master · MikeMcl/decimal.js
Author   MikeMcl
🌐
GitHub
github.com › Agrora › decimal-js
GitHub - Agrora/decimal-js: DecimalJS is an arbitrary precision floating point arithmetic library based on PHP's bcmath extension.
// Pull project git clone https://github.com/Agrora/decimal-js // Enter project directory cd decimal-js // Install development dependencies npm install // ... make your changes ...
Author   Agrora
Find elsewhere
🌐
StackBlitz
stackblitz.com › edit › decimal-js
Decimal Js - StackBlitz
Blank starter project for building TypeScript apps.
🌐
UNPKG
unpkg.com › decimal.js
decimal.js
github.com/MikeMcl/decimal.js · MikeMcl/decimal.js · 6 files · github.com/MikeMcl/decimal.js · MikeMcl/decimal.js · Latest: 10.6.0 ·
🌐
GitHub
github.com › tc39 › proposal-decimal
GitHub - tc39/proposal-decimal: Built-in exact decimal numbers for JavaScript · GitHub
Built-in exact decimal numbers for JavaScript. Contribute to tc39/proposal-decimal development by creating an account on GitHub.
Author   tc39
🌐
jsDelivr
jsdelivr.com › package › npm › decimal.js-light
decimal.js-light CDN by jsDelivr - A CDN for npm and GitHub
September 30, 2020 - A free, fast, and reliable CDN for decimal.js-light. An arbitrary-precision Decimal type for JavaScript.
Published   Feb 25, 2016
🌐
jsDelivr
jsdelivr.com › package › npm › js-big-decimal
js-big-decimal CDN by jsDelivr - A CDN for npm and GitHub
December 29, 2024 - A free, fast, and reliable CDN for js-big-decimal. Work with large numbers on the client side. Round them off to any required precision.
Published   Jul 01, 2017
🌐
GitHub
github.com › MikeMcl › decimal.js › blob › master › CHANGELOG.md
decimal.js/CHANGELOG.md at master · MikeMcl/decimal.js
An arbitrary-precision Decimal type for JavaScript - decimal.js/CHANGELOG.md at master · MikeMcl/decimal.js
Author   MikeMcl
🌐
W3Schools
w3schools.com › jsref › jsref_tofixed.asp
W3Schools.com
cssText getPropertyPriority() ... · The toFixed() method converts a number to a string. The toFixed() method rounds the string to a specified number of decimals....
🌐
Technical Manuals
manuals.muthu.co › posts › javascript-libraries-and-functions › decimaljs.html
Decimal.js - Documentation – Technical Manuals
For browser usage without a module bundler, you can include the Decimal.js script directly in your HTML file. Download the decimal.min.js file from the project’s website and add a <script> tag to your HTML:
🌐
Stack Overflow
stackoverflow.com › questions › 57751186 › newb-question-im-just-having-trouble-using-decimal-js-in-my-script
Newb question: I'm just having trouble using decimal.js in my script
The problem was the src link. And my downloaded file wasn't linking either, because of a Chromebook path issue. The answer is simply to put the htm file in the same folder as decimal.js, and use the short link for src.
🌐
jsDelivr
jsdelivr.com › package › npm › decimal
decimal CDN by jsDelivr - A CDN for npm and GitHub
December 25, 2011 - A free, fast, and reliable CDN for decimal. Simple decimal arithmetic for the browser and node.js!
Published   Dec 25, 2011
🌐
Decimali
decimali.sh
Decimalish — arbitrary-precision decimal primitives for JavaScript.
Decimalish can be used anywhere you use JavaScript. It supports decades-old browsers, modern module-aware Node.js, and web compilers like Webpack.