Get started with numbers.js CDN

Apache-2.0 licensed

Lightweight library: Numbers.js for arithmetic, number manipulation.

Tags:
  • math
  • mathematics
  • numbers
  • statistics

Stable version

Copied!

How to start using numbers.js CDN


// Include the numbers.js library using the CDN link
const Numbers = require('numbers.js');

// Create instances of the Numbers class
const num1 = new Numbers('123.45');
const num2 = new Numbers('678.90');

// Perform arithmetic operations
const sum = num1.add(num2);
const difference = num1.subtract(num2);
const product = num1.multiply(num2);
const quotient = num1.divide(num2);

// Log the results
console.log('Sum:', sum.toFixed(2));
console.log('Difference:', difference.toFixed(2));
console.log('Product:', product.toFixed(2));
console.log('Quotient:', quotient.toFixed(2));
Copied!
Copied!

All versions