0.1.4 • Published 8 months ago

calc-expression v0.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

calc-expression

This project is a JavaScript library for precise calculations. It is built on top of bignumber.js and simplifies the usage by allowing calculation of arithmetic expressions with accurate results. It supports addition, subtraction, multiplication, division, modulus, and exponentiation.

Installation

To install the library, run the following command:

npm install calc-expression

Usage

ES module

import calculate from "calc-expression";
console.log(calculate("0.1 + 0.2")); // "0.3"

CommonJS

const  calculate = require("calc-expression").default;
let a = 0.1; let b = 0.2;
console.log(calculate(`${a} + ((5 * ${b} ** 3) + 1) - (2e3 % 3) / 4`));  // "0.64"
0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago