@w07/big-number
v0.0.2
Published
大数运算
Downloads
1
Readme
大数运算
npm i @w07/big-number
import {BigNumber} from "@w07/big-number";
let m1 = new BigNumber('99999999999999999999.344343');
let m2 = new BigNumber('88888888888888888888.1212127');
console.log(m1.add(m2).originalStr()); //加
console.log(m1.sub(m2).originalStr()); //减
console.log(m1.mul(m2).originalStr()); //乘
console.log(m1.div(m2,6).originalStr()); //除(无限小数需要传保留位数)
console.log(m1.add(m2).mul(m2).originalStr()); //链式调用
console.log(m1.add(12).mul('232323232.22').sub('0.1').originalStr()); //链式调用