1 # [Numeral.js](http://numeraljs.com/)
3 A javascript library for formatting and manipulating numbers.
5 [Website and documentation](http://numeraljs.com/)
10 Master [![Build Status](https://api.travis-ci.org/adamwdraper/Numeral-js.png)](https://travis-ci.org/adamwdraper/Numeral-js)
12 Develop [![Build Status](https://travis-ci.org/adamwdraper/Numeral-js.png?branch=develop)](https://travis-ci.org/adamwdraper/Numeral-js)
17 Please submit all pull requests to the `develop` branch.
21 2. [Install grunt](http://gruntjs.com/getting-started#installing-the-cli)
23 3. Run `npm install` to install dependencies
25 4. Add your tests to the files in `/tests`
27 5. To test your tests, run `grunt`
29 6. When all your tests are passing, run `grunt build` to minify all files
31 7. Submit a pull request to the `develop` branch.
36 When naming language files use the [ISO 639-1 language codes](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) supplemented by [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes when necessary.
38 ### Language translations will not be merged without unit tests.
40 See [the english unit tests](https://github.com/adamwdraper/Numeral-js/blob/master/tests/languages/en-gb.js) for an example.
47 Added currency symbol to optionally appear before negative sign / open paren
49 Added float precision math support
51 Added specification of abbreviation in thousands, millions, billions
55 Bug fix: Unformat should pass through if given a number
57 Added a mechanism to control rounding behaviour
59 Added languageData() for getting and setting language props at runtime
63 Bug fix: Make sure values aren't changed during formatting
67 Add defaultFormat(). numeral().format() uses the default to format if no string is provided
69 .unformat() returns 0 when passed no string
71 Added languages.js that contains all languages
73 Bug fix: Fix bug while unformatting ordinals
75 Add format option to always show signed value
77 Added ability to instantiate numeral with a string value of a number
81 Bug fix: Fix bug while unformatting ordinals
85 Bug fix: Throw error if language is not defined
89 Bug fix: Fix typo for trillion
93 Bug fix: remove ' from unformatting regex that was causing an error with fr-ch.js
97 Add zeroFormat() function that accepts a string for custom formating of zeros
99 Add valueOf() function
101 Chain functionality to language function
103 Make all minified files have the same .min.js filename ending
107 Bug fix: Bytes not formatting correctly
111 Add optional format for all decimals
115 Remove AMD module id. (This is encouraged by require.js to make the module more portable, and keep it from creating a global)
119 AMD define() compatibility.
123 Bug fix: Formatting some numbers results in the wrong value. Issue #21
127 Bug fix: Minor fix to unformatting parser
131 Add support for spaces before/after $, a, o, b in a format string
133 Bug fix: Fix unformat for languages that use '.' in ordinals
135 Bug fix: Fix round up floating numbers with no precision correctly.
137 Bug fix: Fix currency signs at the end in unformat
141 Add support for optional decimal places
145 Add support for appending currency symbol
149 Add support for humanized filesizes
153 Bug Fix: Fix unformatting for languages that use '.' as thousands delimiter
157 Changed language definition property 'money' to 'currency'
161 Bug fix: Fix unformatting non-negative abbreviations
167 Update testing for to include languages
173 Bug fix: Fix difference returning negative values
177 Bug fix: Non negative numbers were displaying as negative when using parentheses
181 Add ordinal formatting using 'o' in the format
185 Add clone functionality
189 Added abbreviations for thousands and millions using 'a' in the format
198 Numeral.js, while less complex, was inspired by and heavily borrowed from [Moment.js](http://momentjs.com)
203 Numeral.js is freely distributable under the terms of the MIT license.
205 Copyright (c) 2012 Adam Draper
207 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
208 files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,
209 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
211 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
213 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.