@rc-component/mini-decimal
Lite lib to only support decimal add calculation
Last updated 6 months ago by zombiej .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @rc-component/mini-decimal 
SYNC missed versions from official npm registry.

@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

Current Tags

  • 1.1.4                                ...           latest (6 months ago)

7 Versions

  • 1.1.4                                ...           6 months ago
  • 1.1.3                                ...           8 months ago
  • 1.1.2                                ...           8 months ago
  • 1.1.1                                ...           8 months ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Downloads
Total 18
Today 0
This Week 6
This Month 7
Last Day 3
Last Week 0
Last Month 8
Dependencies (1)
Dev Dependencies (18)

© 2010 - cnpmjs.org x YWFE | Home | YWFE