@isaidnocookies/stringmath
Package to handle math functions using JS strings
Last updated a year ago by isaidnocookies .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @isaidnocookies/stringmath 
SYNC missed versions from official npm registry.

StringMath is a basic module that allows common math functions to be applied to strings.

Current functions are:

  • add
  • subtract
  • isGreaterThan
  • isGreaterThanOrEqualTo
  • isLessThan
  • isLessThanOrEqualTo
  • isEqual
  • roundUpToNearest0001
  • sciToDecimal

Current Limitations!

  • Does not support negative numbers

Useage

Coming soon...

Installation

$ npm install -s @isaidnocookies/StringMath

Useage

var StringMath = require('@isaidnocookies/StringMath');

var stringmath = new StringMath();
var addresult = parseFloat(stringmath.add("0.001", "0.002"));
var subresult = parseFloat(stringmath.subtract("0.2", "0.1"));

console.log("0.001 + 0.002 = " + addresult); // '0.003'
console.log("0.2 - 0.1 = " + subresult); // '0.01'

Also, check out ThreeBx

Current Tags

  • 1.2.3                                ...           latest (a year ago)

6 Versions

  • 1.2.3                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 6
This Month 9
Last Day 0
Last Week 0
Last Month 3
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |