valepresente / numbers-utils

A great utils to work with numbers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NumbersUtils.js

A great coffee utils to work with numbers.

Signatures

First, the programmer needs to instanciate NumbersUtils class.

NumbersUtils = require 'numbers-utils'
numberUtils = new NumberUtils

In sequence, the result object has the follow methods

.toFloat(amount)

numberUtils.toFloat '11.2'
-> 11.2
numberUtils.toFloat '3,000.00'
-> 3000

.toCurrency(amount, precision)

numberUtils.toCurrency 21202001201.2, 4
-> '21,202,001,201.20000'

Developers

To compile and distribute version of NumberUtils, some pré-requisites needle:

  • make
  • nodejs
  • npm
  • coffee-script npm install -g coffee-script
  • uglyfi npm install -g uglify-js

To compile source, just make deploy must be executed.

Testing

jasminejs is used as BDD suite. To run all tests just execute make test or npm test.

Contributors

Igor Escobar @igorescobar

Michael Granados @dgmike

Copyright (c) 2014 Vale Presente. This software is licensed under the MIT License.

About

A great utils to work with numbers


Languages

Language:CoffeeScript 60.1%Language:JavaScript 39.9%