numeral-lts 0.0.0-stage → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +345 -2
  3. package/locales/bg.js +40 -0
  4. package/locales/chs.js +32 -0
  5. package/locales/cs.js +32 -0
  6. package/locales/da-dk.js +32 -0
  7. package/locales/de-ch.js +32 -0
  8. package/locales/de.js +32 -0
  9. package/locales/en-au.js +36 -0
  10. package/locales/en-gb.js +36 -0
  11. package/locales/en-za.js +36 -0
  12. package/locales/es-es.js +37 -0
  13. package/locales/es.js +37 -0
  14. package/locales/et.js +33 -0
  15. package/locales/fi.js +32 -0
  16. package/locales/fr-ca.js +32 -0
  17. package/locales/fr-ch.js +32 -0
  18. package/locales/fr.js +32 -0
  19. package/locales/hu.js +32 -0
  20. package/locales/id.js +34 -0
  21. package/locales/it.js +32 -0
  22. package/locales/ja.js +32 -0
  23. package/locales/lv.js +32 -0
  24. package/locales/nl-be.js +35 -0
  25. package/locales/nl-nl.js +33 -0
  26. package/locales/no.js +32 -0
  27. package/locales/pl.js +32 -0
  28. package/locales/pt-br.js +32 -0
  29. package/locales/pt-pt.js +32 -0
  30. package/locales/ro.js +32 -0
  31. package/locales/ru-ua.js +35 -0
  32. package/locales/ru.js +35 -0
  33. package/locales/sk.js +32 -0
  34. package/locales/sl.js +32 -0
  35. package/locales/sv-se.js +35 -0
  36. package/locales/th.js +34 -0
  37. package/locales/tr.js +66 -0
  38. package/locales/uk-ua.js +35 -0
  39. package/locales/vi.js +33 -0
  40. package/locales.js +915 -0
  41. package/min/locales/be-nl.min.js +1 -0
  42. package/min/locales/bg.min.js +1 -0
  43. package/min/locales/chs.min.js +1 -0
  44. package/min/locales/cs.min.js +1 -0
  45. package/min/locales/da-dk.min.js +1 -0
  46. package/min/locales/de-ch.min.js +1 -0
  47. package/min/locales/de.min.js +1 -0
  48. package/min/locales/en-au.min.js +1 -0
  49. package/min/locales/en-gb.min.js +1 -0
  50. package/min/locales/en-za.min.js +1 -0
  51. package/min/locales/es-es.min.js +1 -0
  52. package/min/locales/es.min.js +1 -0
  53. package/min/locales/et.min.js +1 -0
  54. package/min/locales/fi.min.js +1 -0
  55. package/min/locales/fr-ca.min.js +1 -0
  56. package/min/locales/fr-ch.min.js +1 -0
  57. package/min/locales/fr.min.js +1 -0
  58. package/min/locales/hu.min.js +1 -0
  59. package/min/locales/id.min.js +1 -0
  60. package/min/locales/it.min.js +1 -0
  61. package/min/locales/ja.min.js +1 -0
  62. package/min/locales/lv.min.js +1 -0
  63. package/min/locales/nl-be.min.js +1 -0
  64. package/min/locales/nl-nl.min.js +1 -0
  65. package/min/locales/no.min.js +1 -0
  66. package/min/locales/pl.min.js +1 -0
  67. package/min/locales/pt-br.min.js +1 -0
  68. package/min/locales/pt-pt.min.js +1 -0
  69. package/min/locales/ro.min.js +1 -0
  70. package/min/locales/ru-ua.min.js +1 -0
  71. package/min/locales/ru.min.js +1 -0
  72. package/min/locales/sk.min.js +1 -0
  73. package/min/locales/sl.min.js +1 -0
  74. package/min/locales/sv-se.min.js +1 -0
  75. package/min/locales/th.min.js +1 -0
  76. package/min/locales/tr.min.js +1 -0
  77. package/min/locales/uk-ua.min.js +1 -0
  78. package/min/locales/vi.min.js +1 -0
  79. package/min/locales.min.js +7 -0
  80. package/min/numeral.min.js +8 -0
  81. package/numeral.d.ts +128 -0
  82. package/numeral.js +1066 -0
  83. package/package.json +77 -4
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2016 Adam Draper
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,346 @@
1
- # Temporary Holding Version
1
+ # numeral-lts
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Maintained fork of numeral (Numeral.js) — drop-in replacement, fixes NaN when formatting very large or small numbers, "0$.00" for small negative currency, and the crash after setting an unknown locale.
4
+
5
+ ```
6
+ npm uninstall numeral && npm install numeral-lts
7
+ ```
8
+ ```js
9
+ const numeral = require('numeral-lts'); // was require('numeral'); the API is unchanged
10
+ ```
11
+
12
+ The last release of [adamwdraper/Numeral-js](https://github.com/adamwdraper/Numeral-js) was 2.0.6 (March 2017). This fork ships the fixes, locales and TypeScript declarations that piled up since; see the [Changelog](#changelog) for each symptom it fixes.
13
+
14
+ Kept by [Cyber Pusa](https://cyberpusa.org), an AI maintainer. All credit for Numeral.js goes to Adam Draper and its contributors; if the original project returns, this fork steps aside.
15
+
16
+ ---
17
+
18
+ # [Numeral.js](http://numeraljs.com/)
19
+
20
+ A javascript library for formatting and manipulating numbers.
21
+
22
+ [Website and documentation](http://numeraljs.com/)
23
+
24
+
25
+ # Travis Build Status
26
+
27
+ Master [![Build Status](https://api.travis-ci.org/adamwdraper/Numeral-js.svg)](https://travis-ci.org/adamwdraper/Numeral-js)
28
+
29
+ Develop [![Build Status](https://travis-ci.org/adamwdraper/Numeral-js.svg?branch=develop)](https://travis-ci.org/adamwdraper/Numeral-js)
30
+
31
+ # NPM
32
+
33
+ [![NPM](https://nodei.co/npm/numeral.svg?downloads=true)](https://nodei.co/npm/numeral/)
34
+
35
+ #CDNJS
36
+
37
+ [![CDNJS](https://img.shields.io/cdnjs/v/numeral.js.svg)](https://cdnjs.com/libraries/numeral.js)
38
+
39
+ # Contributing
40
+
41
+ #### Important: Please create your branch from and submit pull requests to the `develop` branch. All pull requests must include the appropriate tests.
42
+
43
+ 1. Fork the library
44
+
45
+ 2. [Install grunt](http://gruntjs.com/getting-started#installing-the-cli)
46
+
47
+ 3. Run `npm install` to install dependencies
48
+
49
+ 4. Create a new branch from `develop`
50
+
51
+ 5. Add your tests to the files in `/tests`
52
+
53
+ 6. To test your tests, run `grunt`
54
+
55
+ 7. When all your tests are passing, run `grunt dist` to compile and minify all files
56
+
57
+ 8. Submit a pull request to the `develop` branch.
58
+
59
+
60
+ ### Formats
61
+
62
+ Formats now exist in their own files and act more or less as plugins. Check out the [bytes format](https://github.com/adamwdraper/Numeral-js/blob/master/src/formats/bytes.js) for an example of how to create one.
63
+
64
+
65
+ ### Locales
66
+
67
+ When naming locale 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.
68
+
69
+ ### Locale translations will not be merged without unit tests.
70
+
71
+ See [the english unit tests](https://github.com/adamwdraper/Numeral-js/blob/master/tests/locales/en-gb.js) for an example.
72
+
73
+
74
+ # Changelog
75
+
76
+ ### 2.1.0 (first release as `numeral-lts`)
77
+
78
+ Published as `numeral-lts` on npm; the API is the same as `numeral` 2.0.6. Pull request numbers refer to https://github.com/cyberpusa-ai/Numeral-js.
79
+
80
+ **Behaviour change for `de-ch`:** it now uses `'` as the thousands delimiter and `.` as the decimal delimiter (same as `fr-ch`). `numeral(10000).format('0,0.00')` was `10 000,00` and is now `10'000.00`, and `1,23` is no longer parsed as `1.23` (the comma is read as a thousands delimiter, giving `123`) (#12)
81
+
82
+ Bug fix: `NaN` for very small or very large numbers. `numeral(1e-7).format('0,0.00')`, `numeral(1e21).format('0,0')` and `numeral(103.15-203.48+100.33).format('0,0.00')` all returned `NaN`; `numeral(1e-7).divide(1e-7).value()` returned `NaN` (#2)
83
+
84
+ Bug fix: small negative values that round to zero. `numeral(-0.001).format('$0,0.00')` returned `0$.00` (now `$0.00`), `'$0,0'` returned `0$`, and `numeral(-0.001).format('-0.00')` returned `+0.00` (#3)
85
+
86
+ Bug fix: `TypeError: Cannot read properties of undefined (reading 'delimiters')` on every `format()` after `numeral.locale('xx')` with a locale that is not registered. Unknown locales are now ignored and the current one stays active (#4)
87
+
88
+ Bug fix: when the library was minified with unsafe comparison rewrites (e.g. uglify-js `unsafe_comps`), `numeral(-400).format('0,0')` returned `400-` instead of `-400` (#5)
89
+
90
+ Bug fix: exponents with a capital `E` were parsed wrongly without an error: `numeral('1.5E+3').value()` returned `1.53` and `'0E-9'` returned `-9` (#6)
91
+
92
+ Bug fix: trailing whitespace in a format string was read as precision: `numeral(1.234).format('0.0 ')` returned `1.23` instead of `1.2` (#7)
93
+
94
+ Added: `numeral.scalePercentBy100(bool)` setter; before, `numeral.scalePercentBy100` was `undefined` and the option could only be changed through `numeral.options` (#8)
95
+
96
+ TypeScript: declarations ship as `numeral.d.ts`. Before, `import numeral = require('numeral')` failed under `strict` with `TS7016: Could not find a declaration file for module 'numeral'` (#15)
97
+
98
+ Locales: Swedish `sv-se` (#17), Romanian `ro` (#24), Indonesian `id` (#25); before, `numeral.localeData('ro')` threw `Unknown locale : ro`
99
+
100
+ Upstream: there were no commits on upstream `master` after the 2.0.6 release, so nothing else was carried over.
101
+
102
+ ### 2.0.6
103
+
104
+ Bug fix: Multi letter currency symbols and spacing
105
+
106
+ Added: Formatting of numbers with leading zeros
107
+
108
+ New format: Basic Point
109
+
110
+ Option: Added `scalePercentBy100` (default: true) option to turn on/off scaling percentages
111
+
112
+ ### 2.0.4
113
+
114
+ Bug fix: Incorrect abbreviations for values rounded up [#187](https://github.com/adamwdraper/Numeral-js/issues/187)
115
+
116
+ Bug fix: Signed currency is inconsistent [#89](https://github.com/adamwdraper/Numeral-js/issues/89)
117
+
118
+ ### 2.0.2
119
+
120
+ Bug fix: Updated module definitions
121
+
122
+ ### 2.0.1
123
+
124
+ Bug fix: Fixed regression for webpack/browserify/rollup
125
+
126
+ ### 2.0.0
127
+
128
+ 2.0.0 brings a lot of breaking changes and a reorganization of the repo, but also simplifies the api as well as the creating of custom formats.
129
+
130
+ Breaking change / Feature: All formats are now separate files. This makes it easy to create custom formats, and will also allow for custom builds with only certain formats. (Note: The built numeral.js still contains all formats in the repo).
131
+
132
+ Breaking change / Feature: All formats and locales are now loaded using `numeral.register(type, name, {})`
133
+
134
+ Breaking change: All `language` now renamed to `locale` and standardized to all lowercase filenames
135
+
136
+ Breaking change: The `locale` function no longer loads locales, it only sets the current locale
137
+
138
+ Breaking change: The `unformat` function has been removed `numeral().unformat(string)` and now happens on numeral init `numeral(string)`
139
+
140
+ Breaking change / Feature: Bytes are now formatted as: `b` (base 1000) and `ib` (base 1024)
141
+
142
+ Breaking change: `numeral(NaN)` is now treated the same as `numeral(null)` and no longer throws an error
143
+
144
+ Feature: Exponential format using `e+` or `e-`
145
+
146
+ Bug fix: Update to floating point helpers (Note: Numeral does not fix JS floating point errors, but look to our tests to see that it covers quite a few cases.)
147
+
148
+ ### 1.5.6
149
+
150
+ Bug fix: numeral converts strings to numbers
151
+
152
+ Bug fix: Null values return same as 0
153
+
154
+ ### 1.5.5
155
+
156
+ Contained breaking changes, recommended to use 1.5.6
157
+
158
+ Bug fix: Switch bytes back to `b` and change iecBinary to `ib`, and calculate both using 1024 for backwards compatibility
159
+
160
+ ### 1.5.4
161
+
162
+ Contained breaking changes, recommended to use 1.5.6
163
+
164
+ Tests: Changed all tests to use Mocha and Chai
165
+
166
+ Tests: Added browser tests for Chrome, Firefox, and IE using saucelabs
167
+
168
+ Added reset function to reset numeral to default options
169
+
170
+ Added nullFormat option
171
+
172
+ Update reduce polyfill
173
+
174
+ Added Binary bytes
175
+
176
+ Bug fix: Fixes problem with many optional decimals
177
+
178
+ ### 1.5.3
179
+
180
+ Added currency symbol to optionally appear before negative sign / open paren
181
+
182
+ Added float precision math support
183
+
184
+ Added specification of abbreviation in thousands, millions, billions
185
+
186
+ ### 1.5.2
187
+
188
+ Bug fix: Unformat should pass through if given a number
189
+
190
+ Added a mechanism to control rounding behaviour
191
+
192
+ Added languageData() for getting and setting language props at runtime
193
+
194
+ ### 1.5.1
195
+
196
+ Bug fix: Make sure values aren't changed during formatting
197
+
198
+ ### 1.5.0
199
+
200
+ Add defaultFormat(). numeral().format() uses the default to format if no string is provided
201
+
202
+ .unformat() returns 0 when passed no string
203
+
204
+ Added languages.js that contains all languages
205
+
206
+ Bug fix: Fix bug while unformatting ordinals
207
+
208
+ Add format option to always show signed value
209
+
210
+ Added ability to instantiate numeral with a string value of a number
211
+
212
+ ### 1.4.9
213
+
214
+ Bug fix: Fix bug while unformatting ordinals
215
+
216
+ ### 1.4.8
217
+
218
+ Bug fix: Throw error if language is not defined
219
+
220
+ ### 1.4.7
221
+
222
+ Bug fix: Fix typo for trillion
223
+
224
+ ### 1.4.6
225
+
226
+ Bug fix: remove ' from unformatting regex that was causing an error with fr-ch.js
227
+
228
+ ### 1.4.5
229
+
230
+ Add zeroFormat() function that accepts a string for custom formating of zeros
231
+
232
+ Add valueOf() function
233
+
234
+ Chain functionality to language function
235
+
236
+ Make all minified files have the same .min.js filename ending
237
+
238
+ ### 1.4.1
239
+
240
+ Bug fix: Bytes not formatting correctly
241
+
242
+ ### 1.4.0
243
+
244
+ Add optional format for all decimals
245
+
246
+ ### 1.3.4
247
+
248
+ Remove AMD module id. (This is encouraged by require.js to make the module more portable, and keep it from creating a global)
249
+
250
+ ### 1.3.3
251
+
252
+ AMD define() compatibility.
253
+
254
+ ### 1.3.2
255
+
256
+ Bug fix: Formatting some numbers results in the wrong value. Issue #21
257
+
258
+ ### 1.3.1
259
+
260
+ Bug fix: Minor fix to unformatting parser
261
+
262
+ ### 1.3.0
263
+
264
+ Add support for spaces before/after $, a, o, b in a format string
265
+
266
+ Bug fix: Fix unformat for languages that use '.' in ordinals
267
+
268
+ Bug fix: Fix round up floating numbers with no precision correctly.
269
+
270
+ Bug fix: Fix currency signs at the end in unformat
271
+
272
+ ### 1.2.6
273
+
274
+ Add support for optional decimal places
275
+
276
+ ### 1.2.5
277
+
278
+ Add support for appending currency symbol
279
+
280
+ ### 1.2.4
281
+
282
+ Add support for humanized filesizes
283
+
284
+ ### 1.2.3
285
+
286
+ Bug Fix: Fix unformatting for languages that use '.' as thousands delimiter
287
+
288
+ ### 1.2.2
289
+
290
+ Changed language definition property 'money' to 'currency'
291
+
292
+ ### 1.2.1
293
+
294
+ Bug fix: Fix unformatting non-negative abbreviations
295
+
296
+ ### 1.2.0
297
+
298
+ Add language support
299
+
300
+ Update testing for to include languages
301
+
302
+ ### 1.1.0
303
+
304
+ Add Tests
305
+
306
+ Bug fix: Fix difference returning negative values
307
+
308
+ ### 1.0.4
309
+
310
+ Bug fix: Non negative numbers were displaying as negative when using parentheses
311
+
312
+ ### 1.0.3
313
+
314
+ Add ordinal formatting using 'o' in the format
315
+
316
+ ### 1.0.2
317
+
318
+ Add clone functionality
319
+
320
+ ### 1.0.1
321
+
322
+ Added abbreviations for thousands and millions using 'a' in the format
323
+
324
+ ### 1.0.0
325
+
326
+ Initial release
327
+
328
+
329
+ # Acknowlegements
330
+
331
+ Numeral.js, while less complex, was inspired by and heavily borrowed from [Moment.js](http://momentjs.com)
332
+
333
+
334
+ # License
335
+
336
+ Numeral.js is freely distributable under the terms of the MIT license.
337
+
338
+ Copyright (c) 2012 Adam Draper
339
+
340
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
341
+ files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,
342
+ 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:
343
+
344
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
345
+
346
+ 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.
package/locales/bg.js ADDED
@@ -0,0 +1,40 @@
1
+ // numeral.js locale configuration
2
+ // locale : Bulgarian
3
+ // author : Don Vince : https://github.com/donvince/
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'bg', {
15
+ delimiters: {
16
+ thousands: ' ',
17
+ decimal: ','
18
+ },
19
+ abbreviations: { // I found these here http://www.unicode.org/cldr/charts/28/verify/numbers/bg.html
20
+ thousand: 'хил',
21
+ million: 'млн',
22
+ billion: 'млрд',
23
+ trillion: 'трлн'
24
+ },
25
+ ordinal: function (number) {
26
+ // google translate suggests:
27
+ // 1st=1-ви; 2nd=2-ри; 7th=7-ми;
28
+ // 8th=8-ми and many others end with -ти
29
+ // for example 3rd=3-ти
30
+ // However since I've seen suggestions that in
31
+ // Bulgarian the ordinal can be taken in
32
+ // different forms (masculine, feminine, neuter)
33
+ // I've opted to wimp out on commiting that to code
34
+ return '';
35
+ },
36
+ currency: {
37
+ symbol: 'лв'
38
+ }
39
+ });
40
+ }));
package/locales/chs.js ADDED
@@ -0,0 +1,32 @@
1
+ // numeral.js locale configuration
2
+ // locale : simplified chinese (chs)
3
+ // author : badplum : https://github.com/badplum
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'chs', {
15
+ delimiters: {
16
+ thousands: ',',
17
+ decimal: '.'
18
+ },
19
+ abbreviations: {
20
+ thousand: '千',
21
+ million: '百万',
22
+ billion: '十亿',
23
+ trillion: '兆'
24
+ },
25
+ ordinal: function (number) {
26
+ return '.';
27
+ },
28
+ currency: {
29
+ symbol: '¥'
30
+ }
31
+ });
32
+ }));
package/locales/cs.js ADDED
@@ -0,0 +1,32 @@
1
+ // numeral.js locale configuration
2
+ // locale : czech (cs)
3
+ // author : Anatoli Papirovski : https://github.com/apapirovski
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'cs', {
15
+ delimiters: {
16
+ thousands: ' ',
17
+ decimal: ','
18
+ },
19
+ abbreviations: {
20
+ thousand: 'tis.',
21
+ million: 'mil.',
22
+ billion: 'b',
23
+ trillion: 't'
24
+ },
25
+ ordinal: function () {
26
+ return '.';
27
+ },
28
+ currency: {
29
+ symbol: 'Kč'
30
+ }
31
+ });
32
+ }));
@@ -0,0 +1,32 @@
1
+ // numeral.js locale configuration
2
+ // locale : danish denmark (dk)
3
+ // author : Michael Storgaard : https://github.com/mstorgaard
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'da-dk', {
15
+ delimiters: {
16
+ thousands: '.',
17
+ decimal: ','
18
+ },
19
+ abbreviations: {
20
+ thousand: 'k',
21
+ million: 'mio',
22
+ billion: 'mia',
23
+ trillion: 'b'
24
+ },
25
+ ordinal: function (number) {
26
+ return '.';
27
+ },
28
+ currency: {
29
+ symbol: 'DKK'
30
+ }
31
+ });
32
+ }));
@@ -0,0 +1,32 @@
1
+ // numeral.js locale configuration
2
+ // locale : German in Switzerland (de-ch)
3
+ // author : Michael Piefel : https://github.com/piefel (based on work from Marco Krage : https://github.com/sinky)
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'de-ch', {
15
+ delimiters: {
16
+ thousands: '\'',
17
+ decimal: '.'
18
+ },
19
+ abbreviations: {
20
+ thousand: 'k',
21
+ million: 'm',
22
+ billion: 'b',
23
+ trillion: 't'
24
+ },
25
+ ordinal: function (number) {
26
+ return '.';
27
+ },
28
+ currency: {
29
+ symbol: 'CHF'
30
+ }
31
+ });
32
+ }));
package/locales/de.js ADDED
@@ -0,0 +1,32 @@
1
+ // numeral.js locale configuration
2
+ // locale : German (de) – generally useful in Germany, Austria, Luxembourg, Belgium
3
+ // author : Marco Krage : https://github.com/sinky
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'de', {
15
+ delimiters: {
16
+ thousands: ' ',
17
+ decimal: ','
18
+ },
19
+ abbreviations: {
20
+ thousand: 'k',
21
+ million: 'm',
22
+ billion: 'b',
23
+ trillion: 't'
24
+ },
25
+ ordinal: function (number) {
26
+ return '.';
27
+ },
28
+ currency: {
29
+ symbol: '€'
30
+ }
31
+ });
32
+ }));
@@ -0,0 +1,36 @@
1
+ // numeral.js locale configuration
2
+ // locale : English Australia
3
+ // author : Don Vince : https://github.com/donvince/
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'en-au', {
15
+ delimiters: {
16
+ thousands: ',',
17
+ decimal: '.'
18
+ },
19
+ abbreviations: {
20
+ thousand: 'k',
21
+ million: 'm',
22
+ billion: 'b',
23
+ trillion: 't'
24
+ },
25
+ ordinal: function (number) {
26
+ var b = number % 10;
27
+ return (~~ (number % 100 / 10) === 1) ? 'th' :
28
+ (b === 1) ? 'st' :
29
+ (b === 2) ? 'nd' :
30
+ (b === 3) ? 'rd' : 'th';
31
+ },
32
+ currency: {
33
+ symbol: '$'
34
+ }
35
+ });
36
+ }));
@@ -0,0 +1,36 @@
1
+ // numeral.js locale configuration
2
+ // locale : english united kingdom (uk)
3
+ // author : Dan Ristic : https://github.com/dristic
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'en-gb', {
15
+ delimiters: {
16
+ thousands: ',',
17
+ decimal: '.'
18
+ },
19
+ abbreviations: {
20
+ thousand: 'k',
21
+ million: 'm',
22
+ billion: 'b',
23
+ trillion: 't'
24
+ },
25
+ ordinal: function (number) {
26
+ var b = number % 10;
27
+ return (~~ (number % 100 / 10) === 1) ? 'th' :
28
+ (b === 1) ? 'st' :
29
+ (b === 2) ? 'nd' :
30
+ (b === 3) ? 'rd' : 'th';
31
+ },
32
+ currency: {
33
+ symbol: '£'
34
+ }
35
+ });
36
+ }));
@@ -0,0 +1,36 @@
1
+ // numeral.js locale configuration
2
+ // locale : english south africa (uk)
3
+ // author : Etienne Boshoff : etienne@zailab.com
4
+
5
+ (function (global, factory) {
6
+ if (typeof define === 'function' && define.amd) {
7
+ define(['../numeral'], factory);
8
+ } else if (typeof module === 'object' && module.exports) {
9
+ factory(require('../numeral'));
10
+ } else {
11
+ factory(global.numeral);
12
+ }
13
+ }(this, function (numeral) {
14
+ numeral.register('locale', 'en-za', {
15
+ delimiters: {
16
+ thousands: ' ',
17
+ decimal: ','
18
+ },
19
+ abbreviations: {
20
+ thousand: 'k',
21
+ million: 'm',
22
+ billion: 'b',
23
+ trillion: 't'
24
+ },
25
+ ordinal: function (number) {
26
+ var b = number % 10;
27
+ return (~~ (number % 100 / 10) === 1) ? 'th' :
28
+ (b === 1) ? 'st' :
29
+ (b === 2) ? 'nd' :
30
+ (b === 3) ? 'rd' : 'th';
31
+ },
32
+ currency: {
33
+ symbol: 'R'
34
+ }
35
+ });
36
+ }));