0.0.1-beta • Published 4 years ago

babel-auto-numeral v0.0.1-beta

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

babel-auto-numeral

npm.io Code coverage Dependency Status Dev Dependency Status NPM version NPM downloads NPM license

Why?

  1. Solving IEE754 by numeral usually takes 3 times of code, this plugin can resolve +-*/ automatically.
  2. Simulated human computing

Require

babel7

Install from npm

npm i -D babel-auto-numeral

Usage

1. add babel plugin:

{
    "plugins": [
        ["babel-auto-numeral",{"precision": 2,"numeralName": "numeral"}]
    ]
}

2. import numeral and use it

import numeral from 'numeral'; // require numeralName first
const a = 1;
console.log(numeral(a + 0.7 * 0.7)); // 1.49

options

keytypedescription
precisionnumber/null/undefinedto pretend human calculate, this option will fix precision after every step
numeralNamestringtransform the function named with the numeralName
0.0.1-beta

4 years ago