naive-compute
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

naive-tofixed

To fix the error of the operator not preserving decimal places

修正运算符小数位的错误

install

npm install naive-compute

import and use

import compute from 'naive-compute'


console.log(33.33333, '*', 100000) // 3333332.9999999995 damn it !  (`Д´*)9

console.log(compute(33.33333, '*', 100000).result) // 3333333 got it! ╮( ̄▽ ̄)╭

console.log(compute(1024, '+', 1).compute('-', 1).compute('*', 1).compute('/', 1).result) // 1024 ╮( ̄▽ ̄)╭

Readme

Keywords

Package Sidebar

Install

npm i naive-compute

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

5.63 kB

Total Files

7

Last publish

Collaborators

  • xiahouwei