Skip to content

Lite lib to only support decimal add calculation (for Chrome 86+)

License

Notifications You must be signed in to change notification settings

guoyunhe/rc-mini-decimal-modern

 
 

Repository files navigation

@rc-component/mini-decimal

A mini decimal calculator which only support add, multi or compare operation for mini bundle size.

NPM version dumi build status Codecov npm download

Development

npm install
npm test

Usage

import getMiniDecimal from '@rc-component/mini-decimal';

// Add
getMiniDecimal('0.1').add('0.2').toString(); // 0.3

// Multi
getMiniDecimal('0.1').multi('0.2').toString(); // 0.02

// Negate
getMiniDecimal('0.1').negate().toString(); // -0.1

// Equal
getMiniDecimal('0.1').equal('0.1'); // true
getMiniDecimal('0.1').equal('0.2'); // false

// Less Equals
getMiniDecimal('0.1').lessEquals('0.2'); // true
getMiniDecimal('0.1').lessEquals('0.1'); // false

About

Lite lib to only support decimal add calculation (for Chrome 86+)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.3%
  • Other 0.7%