Skip to content

Commit

Permalink
Handling non-finite numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
A---- authored and uniphil committed Apr 14, 2015
1 parent 06ba9ca commit 6bbb40d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
6 changes: 6 additions & 0 deletions min/languages/nb-NO.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*!
* numeral.js language configuration
* language : norwegian
* author : Benjamin Van Ryseghem
*/
!function(){var a={delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"t",million:"M",billion:"md",trillion:"t"},currency:{symbol:"kr",position:"postfix"},defaults:{currencyFormat:",0000 a"},formats:{fourDigits:"0000 a",fullWithTwoDecimals:",0.00 $",fullWithTwoDecimalsNoCurrency:",0.00",fullWithNoDecimals:",0 $"}};"undefined"!=typeof module&&module.exports&&(module.exports=a),"undefined"!=typeof window&&this.numeral&&this.numeral.language&&this.numeral.language("nb-NO",a)}();
2 changes: 1 addition & 1 deletion min/numeral.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions numeral.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@
// check if number is zero and a custom zero format has been set
if (value === 0 && zeroFormat !== null) {
return zeroFormat;
} else if (!isFinite(value)) {
return '' + value;
} else {
// see if we should use parentheses for negative number or if we should prefix with a sign
// if both are present we default to parentheses
Expand Down
Loading

0 comments on commit 6bbb40d

Please sign in to comment.