Skip to content

Commit 1fe2f27

Browse files
committed
Add links
1 parent 1dd317e commit 1fe2f27

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -209,25 +209,21 @@ Adding decimal arithmetic would not be an instance of JS breaking new ground. Ma
209209

210210
| Language | Type Name | Location | Year Added | Notes |
211211
|----------|-----------|----------|------------|-------|
212-
| Python | `decimal.Decimal` | Standard library | 2003 (Python 2.3) | Based on [General Decimal Arithmetic Specification](http://speleotrove.com/decimal/) |
213-
| Java | `java.math.BigDecimal` | Standard library | 1998 (JDK 1.1) | Arbitrary precision, widely used for financial calculations |
214-
| C# | `decimal` | Primitive type | 2000 (C# 1.0) | 128-bit decimal type, first-class language support |
215-
| Swift | `Decimal` (formerly `NSDecimalNumber`) | Foundation framework | 2016 (Swift 3.0) | Standard library type for financial calculations |
216-
| Ruby | `BigDecimal` | Standard library | 1999 (Ruby 1.6) | Arbitrary precision decimal arithmetic |
212+
| Python | [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html) | Standard library | 2003 (Python 2.3) | Based on [General Decimal Arithmetic Specification](http://speleotrove.com/decimal/) |
213+
| Java | [`java.math.BigDecimal`](https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html) | Standard library | 1998 (JDK 1.1) | Arbitrary precision, widely used for financial calculations |
214+
| C# | [`decimal`](https://learn.microsoft.com/en-us/dotnet/api/system.decimal?view=net-9.0) | Primitive structure type | 2000 (C# 1.0) | 128-bit decimal type, first-class language support |
215+
| Swift | [`Decimal`](https://developer.apple.com/documentation/foundation/decimal) (formerly [`NSDecimalNumber`](https://developer.apple.com/documentation/foundation/nsdecimalnumber)) | Foundation framework | 2016 (Swift 3.0) | Standard library type for financial calculations |
216+
| Ruby | [`BigDecimal`](https://ruby-doc.org/stdlib-3.1.0/libdoc/bigdecimal/rdoc/BigDecimal.html) | Standard library | 1999 (Ruby 1.6) | Arbitrary precision decimal arithmetic |
217217

218218
SQL also has `NUMERIC`/`DECIMAL` as a built-in type, predating many programming languages.
219219

220220
Many languages added decimal support 10+ years ago. The IEEE 754-2008 standard for Decimal128 is now 17 years old. (The 2019 edition of IEEE 754 also has decimal arithmetic.)
221-
Indeed, multiple numeric types are not unusual. Languages ship with integers, floats, *and* decimals. Python even includes both decimals and rationals. The existence of JS's `Number` and `BigInt` doesn't preclude `Decimal`. Moreover, the need for decimal types across many languages reflects a genuine, universal need rather than a niche requirement.
222221

223-
### Why JavaScript Lacks Decimal Support
224-
225-
JavaScript's origins as a lightweight browser scripting language meant it initially shipped with minimal numeric support (just IEEE 754 binary floats). However, JavaScript's role has fundamentally changed:
222+
Moreover, having multiple numeric types in a language is not unusual. Languages ship with integers, floats, *and* decimals. (Some even have more numbers than that, such as built-in support for rationals.) Python even includes both decimals and rationals. The existence of JS's `Number` and `BigInt` doesn't preclude `Decimal`. Moreover, the need for decimal types across many languages reflects a genuine, universal need rather than a niche requirement.
226223

227-
- **Then (1995)**: Simple form validation and DOM manipulation
228-
- **Now (2025)**: Full-stack applications, financial systems, e-commerce platforms, serverless backends, data processing pipelines
224+
### Why JavaScript Lacks Decimal Support
229225

230-
The language has evolved to meet modern needs (adding `BigInt`, `async`/`await`, modules, etc.), but decimal arithmetic remains a critical gap.
226+
JavaScript's origins as a lightweight browser scripting language meant it initially shipped with minimal numeric support (just IEEE 754 binary floats). However, JavaScript's role has fundamentally changed. Back in the 1990s, JS was focused on form validation and DOM manipulation. Now we have full-stack applications, including financial systems, e-commerce platforms, serverless backends, and data processing pipelines. The language has evolved to meet modern needs but decimal arithmetic remains an important gap.
231227

232228
### The Cost of Not Having Decimal
233229

@@ -237,13 +233,7 @@ Because JavaScript lacks native decimal support, developers have created numerou
237233
- [**bignumber.js**](https://www.npmjs.com/package/bignumber.js): ~800K weekly npm downloads
238234
- [**big.js**](https://www.npmjs.com/package/big.js): ~500K weekly npm downloads
239235

240-
There are also money-specific libraries such as [dinero.js](https://www.npmjs.com/package/dinero.js) with about 180K weekly NPM downloads.
241-
242-
Each implementation has slightly different semantics, requires coordination across libraries, adds to total bundle size, presumably performs worse than native implementations could, and creates interoperability challenges.
243-
244-
Compare this to BigInt: before native support, polyfills and userland big integer libraries had minimal adoption because the *need* was niche. Decimal libraries show massive adoption because the need is universal.
245-
246-
Thus, Decimal standardizes existing practice. Developers are already using decimal libraries (millions of downloads/week), converting numbers to "cents" (error-prone, confusing), using `Number` incorrectly (causing bugs). Decimal doesn't ask developers to adopt something new; it offers a better way to do what they're already struggling to do.
236+
There are also money-specific libraries such as [dinero.js](https://www.npmjs.com/package/dinero.js) with about 180K weekly NPM downloads. Each implementation has slightly different semantics, requires coordination across libraries, adds to total bundle size, presumably performs worse than native implementations could, and creates interoperability challenges. We believe Decimal will standardize existing practice. Developers are already using decimal libraries, converting numbers to "cents" (error-prone, confusing), using `Number` incorrectly/unsoundly (causing bugs). Decimal doesn't ask developers to adopt something new; it offers a better way to do what they're already struggling to do.
247237

248238
## Specification and standards
249239

0 commit comments

Comments
 (0)