Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.25 KB

File metadata and controls

61 lines (40 loc) · 1.25 KB

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.