numeral-lts 2.1.1 → 2.1.2

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.
package/README.md CHANGED
@@ -75,6 +75,10 @@ See [the english unit tests](https://github.com/adamwdraper/Numeral-js/blob/mast
75
75
 
76
76
  ### Unreleased
77
77
 
78
+ **Bug fix (changes output):** strings with letters between digits are no longer read as numbers. `numeral('123what456').value()` and `numeral('78o0').value()` were `123456` and `780` and are now `null`, the same as other unparseable input. The locale's currency symbol and abbreviations are still allowed, as are leading or trailing text like `$`, `k`, `th`, `KB` or `BPS` (adamwdraper/Numeral-js#449)
79
+
80
+ Added: Persian locale `fa-ir` (currency `﷼`, abbreviations هزار/میلیون/میلیارد/تریلیون, ordinal suffix `ام`). It uses Latin `,` and `.` as delimiters instead of the CLDR Persian `٬` and `٫`, because numeral can only output Latin digits and these are the separators used with Latin digits in Iran (CLDR `fa` latn). Before, `numeral.localeData('fa-ir')` threw `Unknown locale : fa-ir`
81
+
78
82
  Added: Irish English locale `en-ie` (en-gb delimiters, abbreviations and ordinals with currency `€`); before, `numeral.localeData('en-ie')` threw `Unknown locale : en-ie`
79
83
 
80
84
  Added: Traditional Chinese locale `zh-tw` (currency `NT$`, abbreviations 千/百萬/十億/兆); before, `numeral.localeData('zh-tw')` threw `Unknown locale : zh-tw`
@@ -0,0 +1,32 @@
1
+ // numeral.js locale configuration
2
+ // locale : persian iran (fa-ir)
3
+ // author : Ali Abdollahzade : https://github.com/aliabdzad
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', 'fa-ir', {
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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! @preserve
2
2
  * numeral.js
3
- * locales : 2.1.1
3
+ * locales : 2.1.2
4
4
  * license : MIT
5
5
  * http://adamwdraper.github.com/Numeral-js/
6
6
  */
@@ -336,6 +336,28 @@
336
336
  })();
337
337
 
338
338
 
339
+ (function() {
340
+ numeral.register('locale', 'fa-ir', {
341
+ delimiters: {
342
+ thousands: ',',
343
+ decimal: '.'
344
+ },
345
+ abbreviations: {
346
+ thousand: 'هزار',
347
+ million: 'میلیون',
348
+ billion: 'میلیارد',
349
+ trillion: 'تریلیون'
350
+ },
351
+ ordinal: function (number) {
352
+ return 'ام';
353
+ },
354
+ currency: {
355
+ symbol: '﷼'
356
+ }
357
+ });
358
+ })();
359
+
360
+
339
361
  (function() {
340
362
  numeral.register('locale', 'fi', {
341
363
  delimiters: {
@@ -0,0 +1 @@
1
+ ((e,i)=>{"function"==typeof define&&define.amd?define(["../numeral"],i):"object"==typeof module&&module.exports?i(require("../numeral")):i(e.numeral)})(this,function(e){e.register("locale","fa-ir",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"هزار",million:"میلیون",billion:"میلیارد",trillion:"تریلیون"},ordinal:function(e){return"ام"},currency:{symbol:"﷼"}})});
@@ -1 +1 @@
1
- ((i,l)=>{"function"==typeof define&&define.amd?define(["numeral"],l):"object"==typeof module&&module.exports?l(require("./numeral")):l(i.numeral)})(this,function(i){var n;i.register("locale","bg",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"хил",million:"млн",billion:"млрд",trillion:"трлн"},ordinal:function(i){return""},currency:{symbol:"лв"}}),i.register("locale","chs",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百万",billion:"十亿",trillion:"兆"},ordinal:function(i){return"."},currency:{symbol:"¥"}}),i.register("locale","cs",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tis.",million:"mil.",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"Kč"}}),i.register("locale","da-dk",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mio",billion:"mia",trillion:"b"},ordinal:function(i){return"."},currency:{symbol:"DKK"}}),i.register("locale","de-ch",{delimiters:{thousands:"'",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return"."},currency:{symbol:"CHF"}}),i.register("locale","de",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return"."},currency:{symbol:"€"}}),i.register("locale","en-au",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var l=i%10;return 1==~~(i%100/10)?"th":1==l?"st":2==l?"nd":3==l?"rd":"th"},currency:{symbol:"$"}}),i.register("locale","en-gb",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var l=i%10;return 1==~~(i%100/10)?"th":1==l?"st":2==l?"nd":3==l?"rd":"th"},currency:{symbol:"£"}}),i.register("locale","en-ie",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var l=i%10;return 1==~~(i%100/10)?"th":1==l?"st":2==l?"nd":3==l?"rd":"th"},currency:{symbol:"€"}}),i.register("locale","en-za",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var l=i%10;return 1==~~(i%100/10)?"th":1==l?"st":2==l?"nd":3==l?"rd":"th"},currency:{symbol:"R"}}),i.register("locale","es-es",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mm",billion:"b",trillion:"t"},ordinal:function(i){i%=10;return 1==i||3==i?"er":2==i?"do":7==i||0==i?"mo":8==i?"vo":9==i?"no":"to"},currency:{symbol:"€"}}),i.register("locale","es",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mm",billion:"b",trillion:"t"},ordinal:function(i){i%=10;return 1==i||3==i?"er":2==i?"do":7==i||0==i?"mo":8==i?"vo":9==i?"no":"to"},currency:{symbol:"$"}}),i.register("locale","et",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:" tuh",million:" mln",billion:" mld",trillion:" trl"},ordinal:function(i){return"."},currency:{symbol:"€"}}),i.register("locale","fi",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"M",billion:"G",trillion:"T"},ordinal:function(i){return"."},currency:{symbol:"€"}}),i.register("locale","fr-ca",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"M",billion:"G",trillion:"T"},ordinal:function(i){return 1===i?"er":"e"},currency:{symbol:"$"}}),i.register("locale","fr-ch",{delimiters:{thousands:"'",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return 1===i?"er":"e"},currency:{symbol:"CHF"}}),i.register("locale","fr",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return 1===i?"er":"e"},currency:{symbol:"€"}}),i.register("locale","hu",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"E",million:"M",billion:"Mrd",trillion:"T"},ordinal:function(i){return"."},currency:{symbol:" Ft"}}),i.register("locale","id",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"rb",million:"jt",billion:"M",trillion:"T"},ordinal:function(i){return""},currency:{symbol:"Rp"}}),i.register("locale","it",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"mila",million:"mil",billion:"b",trillion:"t"},ordinal:function(i){return"º"},currency:{symbol:"€"}}),i.register("locale","ja",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百万",billion:"十億",trillion:"兆"},ordinal:function(i){return"."},currency:{symbol:"¥"}}),i.register("locale","lv",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:" tūkst.",million:" milj.",billion:" mljrd.",trillion:" trilj."},ordinal:function(i){return"."},currency:{symbol:"€"}}),i.register("locale","nl-be",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:" mln",billion:" mld",trillion:" bln"},ordinal:function(i){var l=i%100;return 0!==i&&l<=1||8==l||20<=l?"ste":"de"},currency:{symbol:"€ "}}),i.register("locale","nl-nl",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mln",billion:"mrd",trillion:"bln"},ordinal:function(i){var l=i%100;return 0!==i&&l<=1||8==l||20<=l?"ste":"de"},currency:{symbol:"€ "}}),i.register("locale","no",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return"."},currency:{symbol:"kr"}}),i.register("locale","pl",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tys.",million:"mln",billion:"mld",trillion:"bln"},ordinal:function(i){return"."},currency:{symbol:"PLN"}}),i.register("locale","pt-br",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"mil",million:"milhões",billion:"b",trillion:"t"},ordinal:function(i){return"º"},currency:{symbol:"R$"}}),i.register("locale","pt-pt",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return"º"},currency:{symbol:"€"}}),i.register("locale","ro",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"K",million:"mil.",billion:"mld.",trillion:"tril."},ordinal:function(i){return 1===i?"":"-lea"},currency:{symbol:"lei"}}),i.register("locale","ru-ua",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тыс.",million:"млн",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"₴"}}),i.register("locale","ru",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тыс.",million:"млн.",billion:"млрд.",trillion:"трлн."},ordinal:function(){return"."},currency:{symbol:"руб."}}),i.register("locale","sk",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tis.",million:"mil.",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"€"}}),i.register("locale","sl",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mio",billion:"mrd",trillion:"trilijon"},ordinal:function(){return"."},currency:{symbol:"€"}}),i.register("locale","sv-se",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"t",million:"mn",billion:"md",trillion:"bn"},ordinal:function(i){var l=i%10;return 1!=~~(i%100/10)&&(1==l||2==l)?":a":":e"},currency:{symbol:"kr"}}),i.register("locale","th",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"พัน",million:"ล้าน",billion:"พันล้าน",trillion:"ล้านล้าน"},ordinal:function(i){return"."},currency:{symbol:"฿"}}),n={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"},i.register("locale","tr",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"bin",million:"milyon",billion:"milyar",trillion:"trilyon"},ordinal:function(i){var l;return 0===i?"'ıncı":n[l=i%10]||n[i%100-l]||n[100<=i?100:null]},currency:{symbol:"₺"}}),i.register("locale","uk-ua",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тис.",million:"млн",billion:"млрд",trillion:"блн"},ordinal:function(){return""},currency:{symbol:"₴"}}),i.register("locale","vi",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:" nghìn",million:" triệu",billion:" tỷ",trillion:" nghìn tỷ"},ordinal:function(){return"."},currency:{symbol:"₫"}}),i.register("locale","zh-tw",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百萬",billion:"十億",trillion:"兆"},ordinal:function(i){return"."},currency:{symbol:"NT$"}})});
1
+ ((i,l)=>{"function"==typeof define&&define.amd?define(["numeral"],l):"object"==typeof module&&module.exports?l(require("./numeral")):l(i.numeral)})(this,function(i){var n;i.register("locale","bg",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"хил",million:"млн",billion:"млрд",trillion:"трлн"},ordinal:function(i){return""},currency:{symbol:"лв"}}),i.register("locale","chs",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百万",billion:"十亿",trillion:"兆"},ordinal:function(i){return"."},currency:{symbol:"¥"}}),i.register("locale","cs",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tis.",million:"mil.",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"Kč"}}),i.register("locale","da-dk",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mio",billion:"mia",trillion:"b"},ordinal:function(i){return"."},currency:{symbol:"DKK"}}),i.register("locale","de-ch",{delimiters:{thousands:"'",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return"."},currency:{symbol:"CHF"}}),i.register("locale","de",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return"."},currency:{symbol:"€"}}),i.register("locale","en-au",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var l=i%10;return 1==~~(i%100/10)?"th":1==l?"st":2==l?"nd":3==l?"rd":"th"},currency:{symbol:"$"}}),i.register("locale","en-gb",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var l=i%10;return 1==~~(i%100/10)?"th":1==l?"st":2==l?"nd":3==l?"rd":"th"},currency:{symbol:"£"}}),i.register("locale","en-ie",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var l=i%10;return 1==~~(i%100/10)?"th":1==l?"st":2==l?"nd":3==l?"rd":"th"},currency:{symbol:"€"}}),i.register("locale","en-za",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var l=i%10;return 1==~~(i%100/10)?"th":1==l?"st":2==l?"nd":3==l?"rd":"th"},currency:{symbol:"R"}}),i.register("locale","es-es",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mm",billion:"b",trillion:"t"},ordinal:function(i){i%=10;return 1==i||3==i?"er":2==i?"do":7==i||0==i?"mo":8==i?"vo":9==i?"no":"to"},currency:{symbol:"€"}}),i.register("locale","es",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mm",billion:"b",trillion:"t"},ordinal:function(i){i%=10;return 1==i||3==i?"er":2==i?"do":7==i||0==i?"mo":8==i?"vo":9==i?"no":"to"},currency:{symbol:"$"}}),i.register("locale","et",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:" tuh",million:" mln",billion:" mld",trillion:" trl"},ordinal:function(i){return"."},currency:{symbol:"€"}}),i.register("locale","fa-ir",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"هزار",million:"میلیون",billion:"میلیارد",trillion:"تریلیون"},ordinal:function(i){return"ام"},currency:{symbol:"﷼"}}),i.register("locale","fi",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"M",billion:"G",trillion:"T"},ordinal:function(i){return"."},currency:{symbol:"€"}}),i.register("locale","fr-ca",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"M",billion:"G",trillion:"T"},ordinal:function(i){return 1===i?"er":"e"},currency:{symbol:"$"}}),i.register("locale","fr-ch",{delimiters:{thousands:"'",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return 1===i?"er":"e"},currency:{symbol:"CHF"}}),i.register("locale","fr",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return 1===i?"er":"e"},currency:{symbol:"€"}}),i.register("locale","hu",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"E",million:"M",billion:"Mrd",trillion:"T"},ordinal:function(i){return"."},currency:{symbol:" Ft"}}),i.register("locale","id",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"rb",million:"jt",billion:"M",trillion:"T"},ordinal:function(i){return""},currency:{symbol:"Rp"}}),i.register("locale","it",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"mila",million:"mil",billion:"b",trillion:"t"},ordinal:function(i){return"º"},currency:{symbol:"€"}}),i.register("locale","ja",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百万",billion:"十億",trillion:"兆"},ordinal:function(i){return"."},currency:{symbol:"¥"}}),i.register("locale","lv",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:" tūkst.",million:" milj.",billion:" mljrd.",trillion:" trilj."},ordinal:function(i){return"."},currency:{symbol:"€"}}),i.register("locale","nl-be",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:" mln",billion:" mld",trillion:" bln"},ordinal:function(i){var l=i%100;return 0!==i&&l<=1||8==l||20<=l?"ste":"de"},currency:{symbol:"€ "}}),i.register("locale","nl-nl",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mln",billion:"mrd",trillion:"bln"},ordinal:function(i){var l=i%100;return 0!==i&&l<=1||8==l||20<=l?"ste":"de"},currency:{symbol:"€ "}}),i.register("locale","no",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return"."},currency:{symbol:"kr"}}),i.register("locale","pl",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tys.",million:"mln",billion:"mld",trillion:"bln"},ordinal:function(i){return"."},currency:{symbol:"PLN"}}),i.register("locale","pt-br",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"mil",million:"milhões",billion:"b",trillion:"t"},ordinal:function(i){return"º"},currency:{symbol:"R$"}}),i.register("locale","pt-pt",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){return"º"},currency:{symbol:"€"}}),i.register("locale","ro",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"K",million:"mil.",billion:"mld.",trillion:"tril."},ordinal:function(i){return 1===i?"":"-lea"},currency:{symbol:"lei"}}),i.register("locale","ru-ua",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тыс.",million:"млн",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"₴"}}),i.register("locale","ru",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тыс.",million:"млн.",billion:"млрд.",trillion:"трлн."},ordinal:function(){return"."},currency:{symbol:"руб."}}),i.register("locale","sk",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"tis.",million:"mil.",billion:"b",trillion:"t"},ordinal:function(){return"."},currency:{symbol:"€"}}),i.register("locale","sl",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"k",million:"mio",billion:"mrd",trillion:"trilijon"},ordinal:function(){return"."},currency:{symbol:"€"}}),i.register("locale","sv-se",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"t",million:"mn",billion:"md",trillion:"bn"},ordinal:function(i){var l=i%10;return 1!=~~(i%100/10)&&(1==l||2==l)?":a":":e"},currency:{symbol:"kr"}}),i.register("locale","th",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"พัน",million:"ล้าน",billion:"พันล้าน",trillion:"ล้านล้าน"},ordinal:function(i){return"."},currency:{symbol:"฿"}}),n={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"},i.register("locale","tr",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:"bin",million:"milyon",billion:"milyar",trillion:"trilyon"},ordinal:function(i){var l;return 0===i?"'ıncı":n[l=i%10]||n[i%100-l]||n[100<=i?100:null]},currency:{symbol:"₺"}}),i.register("locale","uk-ua",{delimiters:{thousands:" ",decimal:","},abbreviations:{thousand:"тис.",million:"млн",billion:"млрд",trillion:"блн"},ordinal:function(){return""},currency:{symbol:"₴"}}),i.register("locale","vi",{delimiters:{thousands:".",decimal:","},abbreviations:{thousand:" nghìn",million:" triệu",billion:" tỷ",trillion:" nghìn tỷ"},ordinal:function(){return"."},currency:{symbol:"₫"}}),i.register("locale","zh-tw",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百萬",billion:"十億",trillion:"兆"},ordinal:function(i){return"."},currency:{symbol:"NT$"}})});
@@ -1 +1 @@
1
- ((e,r)=>{"function"==typeof define&&define.amd?define(r):"object"==typeof module&&module.exports?module.exports=r():e.numeral=r()})(this,function(){var g,u,s,c,e,l={},r={},t={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:t.currentLocale,zeroFormat:t.zeroFormat,nullFormat:t.nullFormat,defaultFormat:t.defaultFormat,scalePercentBy100:t.scalePercentBy100};function o(e,r){this._input=e,this._value=r}return(g=function(e){var r,t,n,i;if(g.isNumeral(e))r=e.value();else if(0===e||void 0===e)r=0;else if(null===e||u.isNaN(e))r=null;else if("string"==typeof e)if(f.zeroFormat&&e===f.zeroFormat)r=0;else if(f.nullFormat&&e===f.nullFormat||!e.replace(/[^0-9]+/g,"").length)r=null;else{for(t in l)if((i="function"==typeof l[t].regexps.unformat?l[t].regexps.unformat():l[t].regexps.unformat)&&e.match(i)){n=l[t].unformat;break}r=(n=n||g._.stringToNumber)(e)}else r=Number(e)||null;return new o(e,r)}).version="2.1.1",g.isNumeral=function(e){return e instanceof o},g._=u={numberToFormat:function(e,r,t){var n,i,o,a,l=g.localeData(),u=!1,s=!1,c="",f=1e12,m="",h=!1,d=-1,b=!1;if(e=e||0,a=Math.abs(e),g._.includes(r,"(")?(u=!0,r=r.replace(/[\(|\)]/g,"")):(g._.includes(r,"+")||g._.includes(r,"-"))&&(d=(b=g._.includes(r,"+"))?r.indexOf("+"):e<0?r.indexOf("-"):-1,r=r.replace(/[\+|\-]/g,"")),g._.includes(r,"a")&&(i=!!(i=r.match(/a(k|m|b|t)?/))&&i[1],g._.includes(r," a")&&(c=" "),r=r.replace(new RegExp(c+"a[kmbt]?"),""),f<=a&&!i||"t"===i?(c+=l.abbreviations.trillion,e/=f):a<f&&1e9<=a&&!i||"b"===i?(c+=l.abbreviations.billion,e/=1e9):a<1e9&&1e6<=a&&!i||"m"===i?(c+=l.abbreviations.million,e/=1e6):(a<1e6&&1e3<=a&&!i||"k"===i)&&(c+=l.abbreviations.thousand,e/=1e3)),g._.includes(r,"[.]")&&(s=!0,r=r.replace("[.]",".")),o=e.toString().split(".")[0],f=r.split(".")[1],a=r.indexOf(","),n=(r.split(".")[0].split(",")[0].match(/0/g)||[]).length,f?(f=f.replace(/^\s+|\s+$/g,""),o=(m=g._.includes(f,"[")?(f=(f=f.replace("]","")).split("["),g._.toFixed(e,f[0].length+f[1].length,t,f[1].length)):g._.toFixed(e,f.length,t)).split(".")[0],m=g._.includes(m,".")?l.delimiters.decimal+m.split(".")[1]:"",s&&0===Number(m.slice(1))&&(m="")):o=g._.toFixed(e,0,t),c&&!i&&1e3<=Number(o)&&c!==l.abbreviations.trillion)switch(o=String(Number(o)/1e3),c){case l.abbreviations.thousand:c=l.abbreviations.million;break;case l.abbreviations.million:c=l.abbreviations.billion;break;case l.abbreviations.billion:c=l.abbreviations.trillion}if(g._.includes(o,"-")&&(o=o.slice(1),h=!0),o.length<n)for(var p=n-o.length;0<p;p--)o="0"+o;return-1<a&&(o=o.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+l.delimiters.thousands)),f=(o=0===r.indexOf(".")?"":o)+m+(c||""),u?f=(u&&h?"(":"")+f+(u&&h?")":""):0<=d&&(h||b)?f=0===d?(h?"-":"+")+f:f+(h?"-":"+"):h&&(f="-"+f),f},stringToNumber:function(e){var r,t,n,i=g.localeData(),o=e,a={thousand:3,million:6,billion:9,trillion:12};if(f.zeroFormat&&e===f.zeroFormat)t=0;else if(f.nullFormat&&e===f.nullFormat||!e.replace(/[^0-9]+/g,"").length)t=null;else{for(r in t=1,"."!==i.delimiters.decimal&&(e=e.replace(/\./g,"").replace(i.delimiters.decimal,".")),a)if(n=new RegExp("[^a-zA-Z]"+i.abbreviations[r]+"(?:\\)|(\\"+i.currency.symbol+")?(?:\\))?)?$"),o.match(n)){t*=Math.pow(10,a[r]);break}t*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),t*=Number(e)}return t},isNaN:function(e){return"number"==typeof e&&isNaN(e)},includes:function(e,r){return-1!==e.indexOf(r)},insert:function(e,r,t){return e.slice(0,t)+r+e.slice(t)},repeat:function(e,r){return new Array(r+1).join(e)},reduce:function(e,r){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof r)throw new TypeError(r+" is not a function");var t,n=Object(e),i=n.length>>>0,o=0;if(3===arguments.length)t=arguments[2];else{for(;o<i&&!(o in n);)o++;if(i<=o)throw new TypeError("Reduce of empty array with no initial value");t=n[o++]}for(;o<i;o++)o in n&&(t=r(t,n[o],o,n));return t},multiplier:function(e){e=u.toNonExponentialString(e).split(".");return e.length<2?1:Math.pow(10,e[1].length)},correctionFactor:function(){return Array.prototype.slice.call(arguments).reduce(function(e,r){r=u.multiplier(r);return r<e?e:r},1)},toFixed:function(e,r,t,n){var i=u.toNonExponentialString(e).split("."),o=e.toString().split("e"),a=r-(n||0),a=2===i.length?Math.min(Math.max(i[1].length,a),r):a,l=Math.pow(10,a),i=2===o.length&&"-"!==o[1].charAt(0)?i[0]+(0<a?"."+u.repeat("0",a):""):(2===o.length?t(o[0]+"e"+(Number(o[1])+a))/l:t(e+"e+"+a)/l).toFixed(a);return r-a<n&&(o=new RegExp("\\.?0{1,"+(n-(r-a))+"}$"),i=i.replace(o,"")),i},toNonExponentialString:function(e){var r,t,n,i,e=e.toString(),o=/^(-)?([0-9]+)\.?([0-9]+)?e([-+])?([0-9]+)$/.exec(e);return o?(r=o[1]||"",t=o[2],n=o[3]||"",i=o[4],o=u.repeat("0",parseInt(o[5],10)-("-"===i?t:n).length),r+("-"===i?"0."+o:"")+t+n+("-"!==i?o:"")):e}},g.options=f,g.formats=l,g.locales=r,g.locale=function(e){return e&&r[e.toLowerCase()]&&(f.currentLocale=e.toLowerCase()),f.currentLocale},g.localeData=function(e){if(!e)return r[f.currentLocale]||r[t.currentLocale];if(e=e.toLowerCase(),r[e])return r[e];throw new Error("Unknown locale : "+e)},g.reset=function(){for(var e in t)f[e]=t[e]},g.zeroFormat=function(e){f.zeroFormat="string"==typeof e?e:null},g.nullFormat=function(e){f.nullFormat="string"==typeof e?e:null},g.defaultFormat=function(e){f.defaultFormat="string"==typeof e?e:"0.0"},g.scalePercentBy100=function(e){f.scalePercentBy100="boolean"!=typeof e||e},g.register=function(e,r,t){if(r=r.toLowerCase(),this[e+"s"][r])throw new TypeError(r+" "+e+" already registered.");return this[e+"s"][r]=t},g.validate=function(e,r){var t,n,i,o;if("string"!=typeof e&&(e+="",console.warn)&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e),(e=e.trim()).match(/^\d+$/))return!0;if(""===e)return!1;try{i=g.localeData(r)}catch(e){i=g.localeData(g.locale())}return r=i.currency.symbol,n=i.abbreviations,t=i.delimiters.decimal,i="."===i.delimiters.thousands?"\\.":i.delimiters.thousands,(null===(o=e.match(/^[^\d]+/))||(e=e.substr(1),o[0]===r))&&!(null!==(o=e.match(/[^\d]+$/))&&(e=e.slice(0,-1),o[0]!==n.thousand)&&o[0]!==n.million&&o[0]!==n.billion&&o[0]!==n.trillion||(r=new RegExp(i+"{2}"),e.match(/[^\d.,]/g))||2<(o=e.split(t)).length||(o.length<2?!o[0].match(/^\d+.*\d$/)||o[0].match(r):1===o[0].length?!o[0].match(/^\d+$/)||o[0].match(r)||!o[1].match(/^\d+$/):!o[0].match(/^\d+.*\d$/)||o[0].match(r)||!o[1].match(/^\d+$/)))},g.fn=o.prototype={clone:function(){return g(this)},format:function(e,r){var t,n,i,o=this._value,a=e||f.defaultFormat;if(r=r||Math.round,0===o&&null!==f.zeroFormat)n=f.zeroFormat;else if(null===o&&null!==f.nullFormat)n=f.nullFormat;else{for(t in l)if(a.match(l[t].regexps.format)){i=l[t].format;break}n=(i=i||g._.numberToFormat)(o,a,r)}return n},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var i=u.correctionFactor.call(null,this._value,e);return this._value=u.reduce([this._value,e],function(e,r,t,n){return e+Math.round(i*r)},0)/i,this},subtract:function(e){var i=u.correctionFactor.call(null,this._value,e);return this._value=u.reduce([e],function(e,r,t,n){return e-Math.round(i*r)},Math.round(this._value*i))/i,this},multiply:function(e){return this._value=u.reduce([this._value,e],function(e,r,t,n){var i=u.correctionFactor(e,r);return Math.round(e*i)*Math.round(r*i)/Math.round(i*i)},1),this},divide:function(e){return this._value=u.reduce([this._value,e],function(e,r,t,n){var i=u.correctionFactor(e,r);return Math.round(e*i)/Math.round(r*i)}),this},difference:function(e){return Math.abs(g(this._value).subtract(e).value())}},g.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var r=e%10;return 1==~~(e%100/10)?"th":1==r?"st":2==r?"nd":3==r?"rd":"th"},currency:{symbol:"$"}}),g.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,r,t){var n=g._.includes(r," BPS")?" ":"";return e*=1e4,r=r.replace(/\s?BPS/,""),e=g._.numberToFormat(e,r,t),e=g._.includes(e,")")?((e=e.split("")).splice(-1,0,n+"BPS"),e.join("")):e+n+"BPS"},unformat:function(e){return+(1e-4*g._.stringToNumber(e)).toFixed(15)}}),c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},e="("+(e=(s={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}).suffixes.concat(c.suffixes.filter(function(e){return s.suffixes.indexOf(e)<0})).join("|")).replace("B","B(?!PS)")+")",g.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(e)},format:function(e,r,t){var n,i,o,a=g._.includes(r,"ib")?c:s,l=g._.includes(r," b")||g._.includes(r," ib")?" ":"";for(r=r.replace(/\s?i?b/,""),n=0;n<=a.suffixes.length;n++)if(i=Math.pow(a.base,n),o=Math.pow(a.base,n+1),null===e||0===e||i<=e&&e<o){l+=a.suffixes[n],0<i&&(e/=i);break}return g._.numberToFormat(e,r,t)+l},unformat:function(e){var r,t,n=g._.stringToNumber(e);if(n){for(r=s.suffixes.length-1;0<=r;r--){if(g._.includes(e,s.suffixes[r])){t=Math.pow(s.base,r);break}if(g._.includes(e,c.suffixes[r])){t=Math.pow(c.base,r);break}}n*=t||1}return n}}),g.register("format","currency",{regexps:{format:/(\$)/},format:function(e,r,t){var n,i,o=g.localeData(),a={before:r.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:r.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(r=r.replace(/\s?\$\s?/,""),n=g._.numberToFormat(e,r,t),g._.includes(n,"-")||g._.includes(n,"(")?g._.includes(a.before,"-")||g._.includes(a.before,"(")||(a.before="-"+a.before):(a.before=a.before.replace(/[\-\(]/,""),a.after=a.after.replace(/[\-\)]/,"")),i=0;i<a.before.length;i++)switch(a.before[i]){case"$":n=g._.insert(n,o.currency.symbol,i);break;case" ":n=g._.insert(n," ",i+o.currency.symbol.length-1)}for(i=a.after.length-1;0<=i;i--)switch(a.after[i]){case"$":n=i===a.after.length-1?n+o.currency.symbol:g._.insert(n,o.currency.symbol,-(a.after.length-(1+i)));break;case" ":n=i===a.after.length-1?n+" ":g._.insert(n," ",-(a.after.length-(1+i)+o.currency.symbol.length-1))}return n}}),g.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/i},format:function(e,r,t){e=("number"!=typeof e||g._.isNaN(e)?"0e+0":e.toExponential()).split("e");return r=r.replace(/e[\+|\-]{1}0/,""),g._.numberToFormat(Number(e[0]),r,t)+"e"+e[1]},unformat:function(e){var e=e.toLowerCase(),r=g._.includes(e,"e+")?e.split("e+"):e.split("e-"),t=Number(r[0]),r=Number(r[1]);return r=g._.includes(e,"e-")?-1*r:r,g._.reduce([t,Math.pow(10,r)],function(e,r,t,n){var i=g._.correctionFactor(e,r);return e*i*(r*i)/(i*i)},1)}}),g.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,r,t){var n=g.localeData(),i=g._.includes(r," o")?" ":"";return r=r.replace(/\s?o/,""),i+=n.ordinal(e),g._.numberToFormat(e,r,t)+i}}),g.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,r,t){var n=g._.includes(r," %")?" ":"";return g.options.scalePercentBy100&&(e*=100),r=r.replace(/\s?\%/,""),e=g._.numberToFormat(e,r,t),e=g._.includes(e,")")?((e=e.split("")).splice(-1,0,n+"%"),e.join("")):e+n+"%"},unformat:function(e){e=g._.stringToNumber(e);return g.options.scalePercentBy100?.01*e:e}}),g.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,r,t){var n=Math.floor(e/60/60),i=Math.floor((e-60*n*60)/60),e=Math.round(e-60*n*60-60*i);return n+":"+(i<10?"0"+i:i)+":"+(e<10?"0"+e:e)},unformat:function(e){var e=e.split(":"),r=0;return 3===e.length?r=(r=(r+=60*Number(e[0])*60)+60*Number(e[1]))+Number(e[2]):2===e.length&&(r=(r+=60*Number(e[0]))+Number(e[1])),Number(r)}}),g});
1
+ ((e,r)=>{"function"==typeof define&&define.amd?define(r):"object"==typeof module&&module.exports?module.exports=r():e.numeral=r()})(this,function(){var g,u,s,c,e,l={},r={},t={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:t.currentLocale,zeroFormat:t.zeroFormat,nullFormat:t.nullFormat,defaultFormat:t.defaultFormat,scalePercentBy100:t.scalePercentBy100};function o(e,r){this._input=e,this._value=r}return(g=function(e){var r,t,n,i;if(g.isNumeral(e))r=e.value();else if(0===e||void 0===e)r=0;else if(null===e||u.isNaN(e))r=null;else if("string"==typeof e)if(f.zeroFormat&&e===f.zeroFormat)r=0;else if(f.nullFormat&&e===f.nullFormat||!e.replace(/[^0-9]+/g,"").length)r=null;else{for(t in l)if((i="function"==typeof l[t].regexps.unformat?l[t].regexps.unformat():l[t].regexps.unformat)&&e.match(i)){n=l[t].unformat;break}r=(n=n||g._.stringToNumber)(e)}else r=Number(e)||null;return new o(e,r)}).version="2.1.2",g.isNumeral=function(e){return e instanceof o},g._=u={numberToFormat:function(e,r,t){var n,i,o,a,l=g.localeData(),u=!1,s=!1,c="",f=1e12,m="",h=!1,d=-1,b=!1;if(e=e||0,a=Math.abs(e),g._.includes(r,"(")?(u=!0,r=r.replace(/[\(|\)]/g,"")):(g._.includes(r,"+")||g._.includes(r,"-"))&&(d=(b=g._.includes(r,"+"))?r.indexOf("+"):e<0?r.indexOf("-"):-1,r=r.replace(/[\+|\-]/g,"")),g._.includes(r,"a")&&(i=!!(i=r.match(/a(k|m|b|t)?/))&&i[1],g._.includes(r," a")&&(c=" "),r=r.replace(new RegExp(c+"a[kmbt]?"),""),f<=a&&!i||"t"===i?(c+=l.abbreviations.trillion,e/=f):a<f&&1e9<=a&&!i||"b"===i?(c+=l.abbreviations.billion,e/=1e9):a<1e9&&1e6<=a&&!i||"m"===i?(c+=l.abbreviations.million,e/=1e6):(a<1e6&&1e3<=a&&!i||"k"===i)&&(c+=l.abbreviations.thousand,e/=1e3)),g._.includes(r,"[.]")&&(s=!0,r=r.replace("[.]",".")),o=e.toString().split(".")[0],f=r.split(".")[1],a=r.indexOf(","),n=(r.split(".")[0].split(",")[0].match(/0/g)||[]).length,f?(f=f.replace(/^\s+|\s+$/g,""),o=(m=g._.includes(f,"[")?(f=(f=f.replace("]","")).split("["),g._.toFixed(e,f[0].length+f[1].length,t,f[1].length)):g._.toFixed(e,f.length,t)).split(".")[0],m=g._.includes(m,".")?l.delimiters.decimal+m.split(".")[1]:"",s&&0===Number(m.slice(1))&&(m="")):o=g._.toFixed(e,0,t),c&&!i&&1e3<=Number(o)&&c!==l.abbreviations.trillion)switch(o=String(Number(o)/1e3),c){case l.abbreviations.thousand:c=l.abbreviations.million;break;case l.abbreviations.million:c=l.abbreviations.billion;break;case l.abbreviations.billion:c=l.abbreviations.trillion}if(g._.includes(o,"-")&&(o=o.slice(1),h=!0),o.length<n)for(var p=n-o.length;0<p;p--)o="0"+o;return-1<a&&(o=o.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+l.delimiters.thousands)),f=(o=0===r.indexOf(".")?"":o)+m+(c||""),u?f=(u&&h?"(":"")+f+(u&&h?")":""):0<=d&&(h||b)?f=0===d?(h?"-":"+")+f:f+(h?"-":"+"):h&&(f="-"+f),f},stringToNumber:function(e){var r,t,n,i=g.localeData(),o=e,a={thousand:3,million:6,billion:9,trillion:12},l=e.split(i.currency.symbol).join(" ");for(r in a)l=l.split(i.abbreviations[r]).join(" ");if(f.zeroFormat&&e===f.zeroFormat)t=0;else if(f.nullFormat&&e===f.nullFormat||!e.replace(/[^0-9]+/g,"").length)t=null;else if(/[0-9][^0-9]*[a-zA-Z][^0-9]*[0-9]/.test(l))t=null;else{for(r in t=1,"."!==i.delimiters.decimal&&(e=e.replace(/\./g,"").replace(i.delimiters.decimal,".")),a)if(n=new RegExp("[^a-zA-Z]"+i.abbreviations[r]+"(?:\\)|(\\"+i.currency.symbol+")?(?:\\))?)?$"),o.match(n)){t*=Math.pow(10,a[r]);break}t*=(e.split("-").length+Math.min(e.split("(").length-1,e.split(")").length-1))%2?1:-1,e=e.replace(/[^0-9\.]+/g,""),t*=Number(e)}return t},isNaN:function(e){return"number"==typeof e&&isNaN(e)},includes:function(e,r){return-1!==e.indexOf(r)},insert:function(e,r,t){return e.slice(0,t)+r+e.slice(t)},repeat:function(e,r){return new Array(r+1).join(e)},reduce:function(e,r){if(null===this)throw new TypeError("Array.prototype.reduce called on null or undefined");if("function"!=typeof r)throw new TypeError(r+" is not a function");var t,n=Object(e),i=n.length>>>0,o=0;if(3===arguments.length)t=arguments[2];else{for(;o<i&&!(o in n);)o++;if(i<=o)throw new TypeError("Reduce of empty array with no initial value");t=n[o++]}for(;o<i;o++)o in n&&(t=r(t,n[o],o,n));return t},multiplier:function(e){e=u.toNonExponentialString(e).split(".");return e.length<2?1:Math.pow(10,e[1].length)},correctionFactor:function(){return Array.prototype.slice.call(arguments).reduce(function(e,r){r=u.multiplier(r);return r<e?e:r},1)},toFixed:function(e,r,t,n){var i=u.toNonExponentialString(e).split("."),o=e.toString().split("e"),a=r-(n||0),a=2===i.length?Math.min(Math.max(i[1].length,a),r):a,l=Math.pow(10,a),i=2===o.length&&"-"!==o[1].charAt(0)?i[0]+(0<a?"."+u.repeat("0",a):""):(2===o.length?t(o[0]+"e"+(Number(o[1])+a))/l:t(e+"e+"+a)/l).toFixed(a);return r-a<n&&(o=new RegExp("\\.?0{1,"+(n-(r-a))+"}$"),i=i.replace(o,"")),i},toNonExponentialString:function(e){var r,t,n,i,e=e.toString(),o=/^(-)?([0-9]+)\.?([0-9]+)?e([-+])?([0-9]+)$/.exec(e);return o?(r=o[1]||"",t=o[2],n=o[3]||"",i=o[4],o=u.repeat("0",parseInt(o[5],10)-("-"===i?t:n).length),r+("-"===i?"0."+o:"")+t+n+("-"!==i?o:"")):e}},g.options=f,g.formats=l,g.locales=r,g.locale=function(e){return e&&r[e.toLowerCase()]&&(f.currentLocale=e.toLowerCase()),f.currentLocale},g.localeData=function(e){if(!e)return r[f.currentLocale]||r[t.currentLocale];if(e=e.toLowerCase(),r[e])return r[e];throw new Error("Unknown locale : "+e)},g.reset=function(){for(var e in t)f[e]=t[e]},g.zeroFormat=function(e){f.zeroFormat="string"==typeof e?e:null},g.nullFormat=function(e){f.nullFormat="string"==typeof e?e:null},g.defaultFormat=function(e){f.defaultFormat="string"==typeof e?e:"0.0"},g.scalePercentBy100=function(e){f.scalePercentBy100="boolean"!=typeof e||e},g.register=function(e,r,t){if(r=r.toLowerCase(),this[e+"s"][r])throw new TypeError(r+" "+e+" already registered.");return this[e+"s"][r]=t},g.validate=function(e,r){var t,n,i,o;if("string"!=typeof e&&(e+="",console.warn)&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",e),(e=(e=e.trim()).replace(/^[+-]/,"")).match(/^\d+$/))return!0;if(""===e)return!1;try{i=g.localeData(r)}catch(e){i=g.localeData(g.locale())}return r=i.currency.symbol,n=i.abbreviations,t=i.delimiters.decimal,i="."===i.delimiters.thousands?"\\.":i.delimiters.thousands,(null===(o=e.match(/^[^\d]+/))||(e=e.substr(1),o[0]===r))&&!(null!==(o=e.match(/[^\d]+$/))&&(e=e.slice(0,-1),o[0]!==n.thousand)&&o[0]!==n.million&&o[0]!==n.billion&&o[0]!==n.trillion||(r=new RegExp(i+"{2}"),e.match(/[^\d.,]/g))||2<(o=e.split(t)).length||(o.length<2?!o[0].match(/^\d+.*\d$/)||o[0].match(r):1===o[0].length?!o[0].match(/^\d+$/)||o[0].match(r)||!o[1].match(/^\d+$/):!o[0].match(/^\d+.*\d$/)||o[0].match(r)||!o[1].match(/^\d+$/)))},g.fn=o.prototype={clone:function(){return g(this)},format:function(e,r){var t,n,i,o=this._value,a=e||f.defaultFormat;if(r=r||Math.round,0===o&&null!==f.zeroFormat)n=f.zeroFormat;else if(null===o&&null!==f.nullFormat)n=f.nullFormat;else{for(t in l)if(a.match(l[t].regexps.format)){i=l[t].format;break}n=(i=i||g._.numberToFormat)(o,a,r)}return n},value:function(){return this._value},input:function(){return this._input},set:function(e){return this._value=Number(e),this},add:function(e){var i=u.correctionFactor.call(null,this._value,e);return this._value=u.reduce([this._value,e],function(e,r,t,n){return e+Math.round(i*r)},0)/i,this},subtract:function(e){var i=u.correctionFactor.call(null,this._value,e);return this._value=u.reduce([e],function(e,r,t,n){return e-Math.round(i*r)},Math.round(this._value*i))/i,this},multiply:function(e){return this._value=u.reduce([this._value,e],function(e,r,t,n){var i=u.correctionFactor(e,r);return Math.round(e*i)*Math.round(r*i)/Math.round(i*i)},1),this},divide:function(e){return this._value=u.reduce([this._value,e],function(e,r,t,n){var i=u.correctionFactor(e,r);return Math.round(e*i)/Math.round(r*i)}),this},difference:function(e){return Math.abs(g(this._value).subtract(e).value())}},g.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(e){var r=e%10;return 1==~~(e%100/10)?"th":1==r?"st":2==r?"nd":3==r?"rd":"th"},currency:{symbol:"$"}}),g.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(e,r,t){var n=g._.includes(r," BPS")?" ":"";return e*=1e4,r=r.replace(/\s?BPS/,""),e=g._.numberToFormat(e,r,t),e=g._.includes(e,")")?((e=e.split("")).splice(-1,0,n+"BPS"),e.join("")):e+n+"BPS"},unformat:function(e){return+(1e-4*g._.stringToNumber(e)).toFixed(15)}}),c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},e="("+(e=(s={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}).suffixes.concat(c.suffixes.filter(function(e){return s.suffixes.indexOf(e)<0})).join("|")).replace("B","B(?!PS)")+")",g.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(e)},format:function(e,r,t){var n,i,o,a=g._.includes(r,"ib")?c:s,l=g._.includes(r," b")||g._.includes(r," ib")?" ":"";for(r=r.replace(/\s?i?b/,""),n=0;n<=a.suffixes.length;n++)if(i=Math.pow(a.base,n),o=Math.pow(a.base,n+1),null===e||0===e||i<=e&&e<o){l+=a.suffixes[n],0<i&&(e/=i);break}return g._.numberToFormat(e,r,t)+l},unformat:function(e){var r,t,n=g._.stringToNumber(e);if(n){for(r=s.suffixes.length-1;0<=r;r--){if(g._.includes(e,s.suffixes[r])){t=Math.pow(s.base,r);break}if(g._.includes(e,c.suffixes[r])){t=Math.pow(c.base,r);break}}n*=t||1}return n}}),g.register("format","currency",{regexps:{format:/(\$)/},format:function(e,r,t){var n,i,o=g.localeData(),a={before:r.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:r.match(/([\+|\-|\)|\s|\$]*)$/)[0]};for(r=r.replace(/\s?\$\s?/,""),n=g._.numberToFormat(e,r,t),g._.includes(n,"-")||g._.includes(n,"(")?g._.includes(a.before,"-")||g._.includes(a.before,"(")||(a.before="-"+a.before):(a.before=a.before.replace(/[\-\(]/,""),a.after=a.after.replace(/[\-\)]/,"")),i=0;i<a.before.length;i++)switch(a.before[i]){case"$":n=g._.insert(n,o.currency.symbol,i);break;case" ":n=g._.insert(n," ",i+o.currency.symbol.length-1)}for(i=a.after.length-1;0<=i;i--)switch(a.after[i]){case"$":n=i===a.after.length-1?n+o.currency.symbol:g._.insert(n,o.currency.symbol,-(a.after.length-(1+i)));break;case" ":n=i===a.after.length-1?n+" ":g._.insert(n," ",-(a.after.length-(1+i)+o.currency.symbol.length-1))}return n}}),g.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/i},format:function(e,r,t){e=("number"!=typeof e||g._.isNaN(e)?"0e+0":e.toExponential()).split("e");return r=r.replace(/e[\+|\-]{1}0/,""),g._.numberToFormat(Number(e[0]),r,t)+"e"+e[1]},unformat:function(e){var e=e.toLowerCase(),r=g._.includes(e,"e+")?e.split("e+"):e.split("e-"),t=Number(r[0]),r=Number(r[1]);return r=g._.includes(e,"e-")?-1*r:r,g._.reduce([t,Math.pow(10,r)],function(e,r,t,n){var i=g._.correctionFactor(e,r);return e*i*(r*i)/(i*i)},1)}}),g.register("format","ordinal",{regexps:{format:/(o)/},format:function(e,r,t){var n=g.localeData(),i=g._.includes(r," o")?" ":"";return r=r.replace(/\s?o/,""),i+=n.ordinal(e),g._.numberToFormat(e,r,t)+i}}),g.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(e,r,t){var n=g._.includes(r," %")?" ":"";return g.options.scalePercentBy100&&(e*=100),r=r.replace(/\s?\%/,""),e=g._.numberToFormat(e,r,t),e=g._.includes(e,")")?((e=e.split("")).splice(-1,0,n+"%"),e.join("")):e+n+"%"},unformat:function(e){e=g._.stringToNumber(e);return g.options.scalePercentBy100?.01*e:e}}),g.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(e,r,t){var r=r.match(/:0*\.(0+)/),n="";return r&&(r=g._.toFixed(e||0,r[1].length,t).split("."),e=Number(r[0]),n="."+r[1]),(t=Math.floor(e/60/60))+":"+((r=Math.floor((e-60*t*60)/60))<10?"0"+r:r)+":"+((e=Math.round(e-60*t*60-60*r))<10?"0"+e:e)+n},unformat:function(e){var e=e.split(":"),r=0;return 3===e.length?r=(r=(r+=60*Number(e[0])*60)+60*Number(e[1]))+Number(e[2]):2===e.length&&(r=(r+=60*Number(e[0]))+Number(e[1])),Number(r)}}),g});
package/numeral.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*! @preserve
2
2
  * numeral.js
3
- * version : 2.1.1
3
+ * version : 2.1.2
4
4
  * author : Adam Draper
5
5
  * license : MIT
6
6
  * http://adamwdraper.github.com/Numeral-js/
@@ -21,7 +21,7 @@
21
21
 
22
22
  var numeral,
23
23
  _,
24
- VERSION = '2.1.1',
24
+ VERSION = '2.1.2',
25
25
  formats = {},
26
26
  locales = {},
27
27
  defaults = {
@@ -276,14 +276,25 @@
276
276
  trillion: 12
277
277
  },
278
278
  abbreviation,
279
+ stripped,
279
280
  value,
280
281
  i,
281
282
  regexp;
282
283
 
284
+ // ignore the locale's currency symbol and abbreviations, which may contain letters
285
+ stripped = string.split(locale.currency.symbol).join(' ');
286
+
287
+ for (abbreviation in abbreviations) {
288
+ stripped = stripped.split(locale.abbreviations[abbreviation]).join(' ');
289
+ }
290
+
283
291
  if (options.zeroFormat && string === options.zeroFormat) {
284
292
  value = 0;
285
293
  } else if (options.nullFormat && string === options.nullFormat || !string.replace(/[^0-9]+/g, '').length) {
286
294
  value = null;
295
+ } else if (/[0-9][^0-9]*[a-zA-Z][^0-9]*[0-9]/.test(stripped)) {
296
+ // letters between digits (e.g. '123what456' or '78o0') are not a number
297
+ value = null;
287
298
  } else {
288
299
  value = 1;
289
300
 
@@ -545,6 +556,9 @@
545
556
  //trim whitespaces from either sides
546
557
  val = val.trim();
547
558
 
559
+ //strip one leading sign, numeral() accepts negative and explicitly positive values
560
+ val = val.replace(/^[+-]/, '');
561
+
548
562
  //if val is just digits return true
549
563
  if (!!val.match(/^\d+$/)) {
550
564
  return true;
@@ -1033,11 +1047,25 @@
1033
1047
  unformat: /(:)/
1034
1048
  },
1035
1049
  format: function(value, format, roundingFunction) {
1036
- var hours = Math.floor(value / 60 / 60),
1037
- minutes = Math.floor((value - (hours * 60 * 60)) / 60),
1038
- seconds = Math.round(value - (hours * 60 * 60) - (minutes * 60));
1050
+ var precision = format.match(/:0*\.(0+)/),
1051
+ fraction = '',
1052
+ rounded,
1053
+ hours,
1054
+ minutes,
1055
+ seconds;
1056
+
1057
+ // fractional seconds (e.g. '00:00:00.000'): round the total once, then split it
1058
+ if (precision) {
1059
+ rounded = numeral._.toFixed(value || 0, precision[1].length, roundingFunction).split('.');
1060
+ value = Number(rounded[0]);
1061
+ fraction = '.' + rounded[1];
1062
+ }
1063
+
1064
+ hours = Math.floor(value / 60 / 60);
1065
+ minutes = Math.floor((value - (hours * 60 * 60)) / 60);
1066
+ seconds = Math.round(value - (hours * 60 * 60) - (minutes * 60));
1039
1067
 
1040
- return hours + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
1068
+ return hours + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds) + fraction;
1041
1069
  },
1042
1070
  unformat: function(string) {
1043
1071
  var timeArray = string.split(':'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "numeral-lts",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "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.",
5
5
  "homepage": "https://github.com/cyberpusa-ai/Numeral-js#readme",
6
6
  "author": {