rc-mini-decimal-modern
v1.1.1
Published
Lite lib to only support decimal add calculation
Downloads
3
Readme
@rc-component/mini-decimal
A mini decimal calculator which only support add
, multi
or compare operation for mini bundle size.
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