Get started with decimal.js CDN
MIT licensed
Decimal.js: High-precision, flexible decimal arithmetic library.
Tags:- arbitrary
- precision
- arithmetic
- big
- number
- decimal
- float
- biginteger
- bigdecimal
- bignumber
- bigint
- bignum
Stable version
Copied!
How to start using decimal.js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with decimal.js CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/decimal.js/10.4.3/decimal.min.js"></script>
</head>
<body>
<script>
// Create Decimal instances
const decimal1 = new Decimal(10.5);
const decimal2 = new Decimal(5.25);
// Perform arithmetic operations
const sum = decimal1.add(decimal2);
const difference = decimal1.subtract(decimal2);
const product = decimal1.multiply(decimal2);
const quotient = decimal1.dividedBy(decimal2);
// Display results
console.log("Sum:", sum.toNumber());
console.log("Difference:", difference.toNumber());
console.log("Product:", product.toNumber());
console.log("Quotient:", quotient.toNumber());
</script>
</body>
</html>
Copied!
Copied!
Copied!
All versions
1.0.0
1.0.1
10.0.0
10.0.1
10.0.2
10.1.0
10.1.1
10.2.0
10.2.1
10.3.0
10.3.1
10.4.0
10.4.1
10.4.2
*** 10.4.3
2.0.0
2.0.1
2.0.2
2.0.3
3.0.0
3.0.1
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
5.0.0
5.0.1
5.0.2
5.0.3
5.0.4
5.0.5
5.0.6
5.0.7
5.0.8
6.0.0
7.0.0
7.1.0
7.1.1
7.1.2
7.2.0
7.2.1
7.2.2
7.2.3
7.2.4
7.3.0
7.4.0
7.5.0
7.5.1
8.0.0
9.0.0
9.0.1