Closed admincopm closed 10 months ago
You can do that with mathjs, which uses decimal.js
under the hood when you configure it to use BigNumber:
import { create, all } from 'mathjs'
const config = {
number: 'BigNumber',
precision: 64
}
const math = create(all, config)
const result = math.evaluate('0.1 + 0.2') // BigNumber 0.3
console.log(result.toString())
Yes, I am currently using math.js to process mathematical expressions
Support for mathematical expression processing without loss of precision