@rc-component/mini-decimal
Lite lib to only support decimal add calculation
Last updated a month ago by zombiej .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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.3                                ...           latest (25 days ago)

6 Versions

  • 1.1.3                                ...           25 days ago
  • 1.1.2                                ...           a month ago
  • 1.1.1                                ...           a month ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Today 0
This Week 1
This Month 3
Last Day 1
Last Week 2
Last Month 0
Dependencies (1)
Dev Dependencies (18)

Copyright 2013 - present © cnpmjs.org | Home |