🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

big_calculate

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

big_calculate

JS计算

latest
npmnpm
Version
1.1.1
Version published
Weekly downloads
23
-30.3%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

javascript

FAQs

Package last updated on 19 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts