You have to import as decimal.js/decimal.
GitHub
github.com › MikeMcl › decimal.js
GitHub - MikeMcl/decimal.js: An arbitrary-precision Decimal type for JavaScript · GitHub
An arbitrary-precision Decimal type for JavaScript. ... The library is similar to bignumber.js, but here precision is specified in terms of significant digits rather than decimal places, and all calculations are rounded to the precision (similar ...
Author MikeMcl
TypeScript the Decimal type is decimal.Decimal instead of Decimal
When I import Decimal.js in my TypeScript project, the type is decimal.Decimal instead of decimal. More on github.com
Show HN: dnum − A small TypeScript library to handle decimal numbers
Creating a new index in between two indices and comparing two indices are both O(N), but the cute part is that the standard string comparison in JavaScript just works · You just encode the digits after the decimal point. As in for "0.15" you encode "15". Except you do it in a big base, and ... More on news.ycombinator.com
Decimal math in TypeScript
Given that Decimal ledger values are encoded by the TypeScript bindings as string values (to avoid loss of precision), is there a recommended library for mathematical operations on these values? https://docs.daml.com/0.… More on discuss.daml.com
Best Decimal Library?
How large are your numbers and how many decimal places? I usually just convert to int then back to decimal: > 1.01+1.02 2.0300000000000002 > (101+102)/100 2.03 More on reddit.com
Mikemcl
mikemcl.github.io › decimal.js
decimal.js API
An arbitrary-precision Decimal type for JavaScript.
npm
npmjs.com › package › decimal.js
decimal.js - npm
July 6, 2025 - Used under the hood by math.js · Includes a TypeScript declaration file: decimal.d.ts ·
» npm install decimal.js
Published Jul 06, 2025
Version 10.6.0
Author Michael Mclaughlin
Repository https://github.com/MikeMcl/decimal.js
Medium
medium.com › @josephgathumbi › decimal-js-vs-c1471b362181
Decimal.js vs. BigNumber.js: Which One Should You Use for High-Precision Arithmetic and Large Numbers? | by Joseph | Medium
January 30, 2025 - When programming in JavaScript or TypeScript, you will at some point encounter extremely large numbers beyond JavaScript’s Number.MAX_SAFE_INTEGER or the need to ensure high precision in floating-point arithmetic. Libraries like Decimal.js and BigNumber.js are designed to address these issues, but many developers are unsure about their differences and how to choose the right one for their projects.
GitHub
github.com › MikeMcl › decimal.js › issues › 68
TypeScript the Decimal type is decimal.Decimal instead of Decimal · Issue #68 · MikeMcl/decimal.js
November 16, 2017 - When I import Decimal.js in my TypeScript project, the type is decimal.Decimal instead of decimal. This is how I imported decimal.js: import * as Decimal from 'decimal.js'; and this is how I have to use it: private value: string | decima...
Published Nov 16, 2017
npm
npmjs.com › package › decimal.js-light
decimal.js-light - npm
September 30, 2020 - Also, in this library the e property of a Decimal is the base 10000000 exponent, not the base 10 exponent as in decimal.js. Use the exponent method to get the base 10 exponent. ... See the documentation for further information. TypeScript type declaration file contributed by TANAKA Koichi.
» npm install decimal.js-light
Published Sep 30, 2020
Version 2.5.1
Author Michael Mclaughlin
Repository https://github.com/MikeMcl/decimal.js-light
Decimali
decimali.sh
Decimalish — arbitrary-precision decimal primitives for ...
Decimalish can be used anywhere you use JavaScript. It supports decades-old browsers, modern module-aware Node.js, and web compilers like Webpack. It comes with TypeScript definitions in the box.
UNPKG
unpkg.com › decimal.js
decimal.js
An arbitrary-precision Decimal type for JavaScript.
Hacker News
news.ycombinator.com › item
Show HN: dnum − A small TypeScript library to handle decimal numbers | Hacker News
July 18, 2023 - Creating a new index in between two indices and comparing two indices are both O(N), but the cute part is that the standard string comparison in JavaScript just works · You just encode the digits after the decimal point. As in for "0.15" you encode "15". Except you do it in a big base, and ...
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › toFixed
Number.prototype.toFixed() - JavaScript | MDN
The toFixed() method returns a string representation of a number without using exponential notation and with exactly digits digits after the decimal point.
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.
You don't need to install any typings. import Decimal from '@agrora/decimal'; // Create a new decimal from a string const decimal = Decimal.from('0.2'); // Use add() to add another decimal to it const sum = decimal.add('0.1'); // Log the result ...
Author Agrora
GitHub
github.com › MikeMcl › decimal.js-light
The light version of decimal.js, an arbitrary-precision ...
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%
Progress
progress.com › blogs › decimals-no-limitations-javascript
Decimals with No Limitations in JavaScript
November 13, 2024 - Here is one last example to show rounding with large numbers: Decimal 1,234,567,890,123 multiplied by Decimal 1 will yield 123460000000. Here, rounding takes place at the 5th digit. There are multiple ways to round numbers. Check the last section on the configuration options for the rounding mode. Corticon.js is used to implement low-code/no-code decision services.