big_calculate
v1.1.0
Published
JS计算
Downloads
4
Readme
big_calculate
介绍
js 字符串计算,解决 javascript 计算精度问题以及大数据计算
安装教程
npm install big_calculate
<script src="@big_calaulate/lib/umd/calculate.dev.js"></script>
使用说明
import _Calculate from "big_calculate";
_Calculate.count("+", 12.121212, 121212.1212, 0.34344); // 121224.585852
_Calculate.count("-", 12.121212, 121212.1212, 0.34344); // 121199.656548
_Calculate.count("*", 12.121212, 121212.1212, 0.34344); // 504595.036225904132736
_Calculate.count("/", 12.121212, 121212.1212, 0.34344); // 0.00029117167193687398061087817
// 四舍五入
_Calculate.toFixeds(1212121.232323232323, 2); // 1212121.23
_Calculate.toFixeds(1212121.23, 2, 5); // 1212121.23
_Calculate.toFixeds(1212121.23121535, 2, 5); // 1212121.23122
// 科学计数法转字符串
_Calculate.exchanges(2.91171671936874e-4); // 0.000291171671936874