A great coffee utils to work with numbers.
First, the programmer needs to instanciate NumbersUtils
class.
NumbersUtils = require 'numbers-utils'
numberUtils = new NumberUtils
In sequence, the result object has the follow methods
numberUtils.toFloat '11.2'
-> 11.2
numberUtils.toFloat '3,000.00'
-> 3000
numberUtils.toCurrency 21202001201.2, 4
-> '21,202,001,201.20000'
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.
jasminejs
is used as BDD suite. To run all tests
just execute make test
or npm test
.
Copyright (c) 2014 Vale Presente. This software is licensed under the MIT License.