Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c790108
added languageData() for getting and setting language props at runtime
ticking-clock Sep 5, 2013
c859238
Added Netherlands-NL.
daclayton Sep 20, 2013
1f5f548
Release
daclayton Sep 20, 2013
c9ba7d0
Update for NL-NL: remove leading space before millions, billions to m…
daclayton Sep 20, 2013
a0a56e2
hungarian language files
pbakondy Sep 25, 2013
82557fa
Add support for French Canadian (fr-CA)
renaudleo Sep 26, 2013
da2d724
Adds an optional argument in Numeral.format for a rounding function.
Oct 19, 2013
2f046d7
Merge branch 'master' into develop
Oct 19, 2013
5831367
Unformat should pass through if given a number
baer Oct 26, 2013
a00de62
Added Slovak localization
alhafoudh Oct 29, 2013
c16dcaf
added languageData() for getting and setting language props at runtime
ticking-clock Sep 5, 2013
4c943e7
Merge branch 'pr/83' of https://github.com/adamwdraper/Numeral-js int…
adamwdraper Oct 30, 2013
8786b75
release
adamwdraper Oct 30, 2013
59252a4
Merge branch 'pr/83' into develop
adamwdraper Oct 30, 2013
df84b40
Merge branch 'pr/91' into develop
adamwdraper Oct 30, 2013
f588563
Merge branch 'pr/92' into develop
adamwdraper Oct 30, 2013
d3692d2
release
adamwdraper Oct 30, 2013
54d725f
Merge branch 'pr/94' into develop
adamwdraper Oct 30, 2013
9af4d76
remove whitespace
adamwdraper Oct 30, 2013
0d75360
Merge branch 'pr/98' into develop
adamwdraper Oct 30, 2013
cb80270
build
adamwdraper Oct 30, 2013
fd2ea10
Merge branch 'pr/99' into develop
adamwdraper Oct 30, 2013
c9ba580
build
adamwdraper Oct 30, 2013
ab8426d
Merge branch 'pr/103' into develop
adamwdraper Oct 30, 2013
4d0be28
update readme and version
adamwdraper Oct 30, 2013
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');

grunt.registerTask('default', [
'test'
]);

grunt.registerTask('test', [
'jshint',
'nodeunit'
]);

// P
grunt.registerTask('release', [
grunt.registerTask('build', [
'jshint',
'nodeunit',
'concat',
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Please submit all pull requests to the `develop` branch.

4. Add your tests to the files in `/tests`

5. To test your tests, run `grunt test`
5. To test your tests, run `grunt`

6. When all your tests are passing, run `grunt release` to minify all files
6. When all your tests are passing, run `grunt build` to minify all files

7. Submit a pull request.
7. Submit a pull request to the `develop` branch.


### Languages
Expand All @@ -42,6 +42,14 @@ See [the english unit tests](https://github.com/adamwdraper/Numeral-js/blob/mast

# Changelog

### 1.5.2

Bug fix: Unformat should pass through if given a number

Added a mechanism to control rounding behaviour

Added languageData() for getting and setting language props at runtime

### 1.5.1

Bug fix: Make sure values aren't changed during formatting
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "numeral",
"repo": "adamwdraper/Numeral-js",
"version": "1.5.1",
"version": "1.5.2",
"description": "Format and manipulate numbers.",
"keywords": [
"numeral",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "numeral",
"repo": "adamwdraper/Numeral-js",
"version": "1.5.1",
"version": "1.5.2",
"description": "Format and manipulate numbers.",
"keywords": [
"numeral",
Expand Down
138 changes: 138 additions & 0 deletions languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,40 @@
}
}());

/*!
* numeral.js language configuration
* language : french (Canada) (fr-CA)
* author : Léo Renaud-Allaire : https://github.com/renaudleo
*/
(function () {
var language = {
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'k',
million: 'M',
billion: 'G',
trillion: 'T'
},
ordinal : function (number) {
return number === 1 ? 'er' : 'e';
},
currency: {
symbol: '$'
}
};

// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('fr-CA', language);
}
}());
/*!
* numeral.js language configuration
* language : french (fr-ch)
Expand Down Expand Up @@ -392,6 +426,40 @@
this.numeral.language('fr', language);
}
}());
/*!
* numeral.js language configuration
* language : Hungarian (hu)
* author : Peter Bakondy : https://github.com/pbakondy
*/
(function () {
var language = {
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'E', // ezer
million: 'M', // millió
billion: 'Mrd', // milliárd
trillion: 'T' // trillió
},
ordinal: function (number) {
return '.';
},
currency: {
symbol: ' Ft'
}
};

// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('hu', language);
}
}());
/*!
* numeral.js language configuration
* language : italian Italy (it)
Expand Down Expand Up @@ -461,6 +529,41 @@
}
}());

/*!
* numeral.js language configuration
* language : netherlands-dutch (nl-nl)
* author : Dave Clayton : https://github.com/davedx
*/
(function () {
var language = {
delimiters: {
thousands: '.',
decimal : ','
},
abbreviations: {
thousand : 'k',
million : 'mln',
billion : 'mrd',
trillion : 'bln'
},
ordinal : function (number) {
var remainder = number % 100;
return (number !== 0 && remainder <= 1 || remainder === 8 || remainder >= 20) ? 'ste' : 'de';
},
currency: {
symbol: '€ '
}
};

// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('nl-nl', language);
}
}());
/*!
* numeral.js language configuration
* language : polish (pl)
Expand Down Expand Up @@ -638,6 +741,41 @@
}
}());

/*!
* numeral.js language configuration
* language : slovak (sk)
* author : Ahmed Al Hafoudh : http://www.freevision.sk
*/
(function () {
var language = {
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'tis.',
million: 'mil.',
billion: 'b',
trillion: 't'
},
ordinal: function () {
return '.';
},
currency: {
symbol: '€'
}
};

// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('sk', language);
}
}());

/*!
* numeral.js language configuration
* language : thai (th)
Expand Down
34 changes: 34 additions & 0 deletions languages/fr-CA.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*!
* numeral.js language configuration
* language : french (Canada) (fr-CA)
* author : Léo Renaud-Allaire : https://github.com/renaudleo
*/
(function () {
var language = {
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'k',
million: 'M',
billion: 'G',
trillion: 'T'
},
ordinal : function (number) {
return number === 1 ? 'er' : 'e';
},
currency: {
symbol: '$'
}
};

// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('fr-CA', language);
}
}());
34 changes: 34 additions & 0 deletions languages/hu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*!
* numeral.js language configuration
* language : Hungarian (hu)
* author : Peter Bakondy : https://github.com/pbakondy
*/
(function () {
var language = {
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'E', // ezer
million: 'M', // millió
billion: 'Mrd', // milliárd
trillion: 'T' // trillió
},
ordinal: function (number) {
return '.';
},
currency: {
symbol: ' Ft'
}
};

// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('hu', language);
}
}());
35 changes: 35 additions & 0 deletions languages/nl-nl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*!
* numeral.js language configuration
* language : netherlands-dutch (nl-nl)
* author : Dave Clayton : https://github.com/davedx
*/
(function () {
var language = {
delimiters: {
thousands: '.',
decimal : ','
},
abbreviations: {
thousand : 'k',
million : 'mln',
billion : 'mrd',
trillion : 'bln'
},
ordinal : function (number) {
var remainder = number % 100;
return (number !== 0 && remainder <= 1 || remainder === 8 || remainder >= 20) ? 'ste' : 'de';
},
currency: {
symbol: '€ '
}
};

// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('nl-nl', language);
}
}());
34 changes: 34 additions & 0 deletions languages/sk.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*!
* numeral.js language configuration
* language : slovak (sk)
* author : Ahmed Al Hafoudh : http://www.freevision.sk
*/
(function () {
var language = {
delimiters: {
thousands: ' ',
decimal: ','
},
abbreviations: {
thousand: 'tis.',
million: 'mil.',
billion: 'b',
trillion: 't'
},
ordinal: function () {
return '.';
},
currency: {
symbol: '€'
}
};

// Node
if (typeof module !== 'undefined' && module.exports) {
module.exports = language;
}
// Browser
if (typeof window !== 'undefined' && this.numeral && this.numeral.language) {
this.numeral.language('sk', language);
}
}());
Loading