locales.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846
  1. /*! @preserve
  2. * numeral.js
  3. * locales : 2.0.6
  4. * license : MIT
  5. * http://adamwdraper.github.com/Numeral-js/
  6. */
  7. (function (global, factory) {
  8. if (typeof define === 'function' && define.amd) {
  9. define(['numeral'], factory);
  10. } else if (typeof module === 'object' && module.exports) {
  11. factory(require('./numeral'));
  12. } else {
  13. factory(global.numeral);
  14. }
  15. }(this, function (numeral) {
  16. (function() {
  17. numeral.register('locale', 'bg', {
  18. delimiters: {
  19. thousands: ' ',
  20. decimal: ','
  21. },
  22. abbreviations: { // I found these here http://www.unicode.org/cldr/charts/28/verify/numbers/bg.html
  23. thousand: 'хил',
  24. million: 'млн',
  25. billion: 'млрд',
  26. trillion: 'трлн'
  27. },
  28. ordinal: function (number) {
  29. // google translate suggests:
  30. // 1st=1-ви; 2nd=2-ри; 7th=7-ми;
  31. // 8th=8-ми and many others end with -ти
  32. // for example 3rd=3-ти
  33. // However since I've seen suggestions that in
  34. // Bulgarian the ordinal can be taken in
  35. // different forms (masculine, feminine, neuter)
  36. // I've opted to wimp out on commiting that to code
  37. return '';
  38. },
  39. currency: {
  40. symbol: 'лв'
  41. }
  42. });
  43. })();
  44. (function() {
  45. numeral.register('locale', 'chs', {
  46. delimiters: {
  47. thousands: ',',
  48. decimal: '.'
  49. },
  50. abbreviations: {
  51. thousand: '千',
  52. million: '百万',
  53. billion: '十亿',
  54. trillion: '兆'
  55. },
  56. ordinal: function (number) {
  57. return '.';
  58. },
  59. currency: {
  60. symbol: '¥'
  61. }
  62. });
  63. })();
  64. (function() {
  65. numeral.register('locale', 'cs', {
  66. delimiters: {
  67. thousands: ' ',
  68. decimal: ','
  69. },
  70. abbreviations: {
  71. thousand: 'tis.',
  72. million: 'mil.',
  73. billion: 'b',
  74. trillion: 't'
  75. },
  76. ordinal: function () {
  77. return '.';
  78. },
  79. currency: {
  80. symbol: 'Kč'
  81. }
  82. });
  83. })();
  84. (function() {
  85. numeral.register('locale', 'da-dk', {
  86. delimiters: {
  87. thousands: '.',
  88. decimal: ','
  89. },
  90. abbreviations: {
  91. thousand: 'k',
  92. million: 'mio',
  93. billion: 'mia',
  94. trillion: 'b'
  95. },
  96. ordinal: function (number) {
  97. return '.';
  98. },
  99. currency: {
  100. symbol: 'DKK'
  101. }
  102. });
  103. })();
  104. (function() {
  105. numeral.register('locale', 'de-ch', {
  106. delimiters: {
  107. thousands: ' ',
  108. decimal: ','
  109. },
  110. abbreviations: {
  111. thousand: 'k',
  112. million: 'm',
  113. billion: 'b',
  114. trillion: 't'
  115. },
  116. ordinal: function (number) {
  117. return '.';
  118. },
  119. currency: {
  120. symbol: 'CHF'
  121. }
  122. });
  123. })();
  124. (function() {
  125. numeral.register('locale', 'de', {
  126. delimiters: {
  127. thousands: ' ',
  128. decimal: ','
  129. },
  130. abbreviations: {
  131. thousand: 'k',
  132. million: 'm',
  133. billion: 'b',
  134. trillion: 't'
  135. },
  136. ordinal: function (number) {
  137. return '.';
  138. },
  139. currency: {
  140. symbol: '€'
  141. }
  142. });
  143. })();
  144. (function() {
  145. numeral.register('locale', 'en-au', {
  146. delimiters: {
  147. thousands: ',',
  148. decimal: '.'
  149. },
  150. abbreviations: {
  151. thousand: 'k',
  152. million: 'm',
  153. billion: 'b',
  154. trillion: 't'
  155. },
  156. ordinal: function (number) {
  157. var b = number % 10;
  158. return (~~ (number % 100 / 10) === 1) ? 'th' :
  159. (b === 1) ? 'st' :
  160. (b === 2) ? 'nd' :
  161. (b === 3) ? 'rd' : 'th';
  162. },
  163. currency: {
  164. symbol: '$'
  165. }
  166. });
  167. })();
  168. (function() {
  169. numeral.register('locale', 'en-gb', {
  170. delimiters: {
  171. thousands: ',',
  172. decimal: '.'
  173. },
  174. abbreviations: {
  175. thousand: 'k',
  176. million: 'm',
  177. billion: 'b',
  178. trillion: 't'
  179. },
  180. ordinal: function (number) {
  181. var b = number % 10;
  182. return (~~ (number % 100 / 10) === 1) ? 'th' :
  183. (b === 1) ? 'st' :
  184. (b === 2) ? 'nd' :
  185. (b === 3) ? 'rd' : 'th';
  186. },
  187. currency: {
  188. symbol: '£'
  189. }
  190. });
  191. })();
  192. (function() {
  193. numeral.register('locale', 'en-za', {
  194. delimiters: {
  195. thousands: ' ',
  196. decimal: ','
  197. },
  198. abbreviations: {
  199. thousand: 'k',
  200. million: 'm',
  201. billion: 'b',
  202. trillion: 't'
  203. },
  204. ordinal: function (number) {
  205. var b = number % 10;
  206. return (~~ (number % 100 / 10) === 1) ? 'th' :
  207. (b === 1) ? 'st' :
  208. (b === 2) ? 'nd' :
  209. (b === 3) ? 'rd' : 'th';
  210. },
  211. currency: {
  212. symbol: 'R'
  213. }
  214. });
  215. })();
  216. (function() {
  217. numeral.register('locale', 'es-es', {
  218. delimiters: {
  219. thousands: '.',
  220. decimal: ','
  221. },
  222. abbreviations: {
  223. thousand: 'k',
  224. million: 'mm',
  225. billion: 'b',
  226. trillion: 't'
  227. },
  228. ordinal: function (number) {
  229. var b = number % 10;
  230. return (b === 1 || b === 3) ? 'er' :
  231. (b === 2) ? 'do' :
  232. (b === 7 || b === 0) ? 'mo' :
  233. (b === 8) ? 'vo' :
  234. (b === 9) ? 'no' : 'to';
  235. },
  236. currency: {
  237. symbol: '€'
  238. }
  239. });
  240. })();
  241. (function() {
  242. numeral.register('locale', 'es', {
  243. delimiters: {
  244. thousands: '.',
  245. decimal: ','
  246. },
  247. abbreviations: {
  248. thousand: 'k',
  249. million: 'mm',
  250. billion: 'b',
  251. trillion: 't'
  252. },
  253. ordinal: function (number) {
  254. var b = number % 10;
  255. return (b === 1 || b === 3) ? 'er' :
  256. (b === 2) ? 'do' :
  257. (b === 7 || b === 0) ? 'mo' :
  258. (b === 8) ? 'vo' :
  259. (b === 9) ? 'no' : 'to';
  260. },
  261. currency: {
  262. symbol: '$'
  263. }
  264. });
  265. })();
  266. (function() {
  267. numeral.register('locale', 'et', {
  268. delimiters: {
  269. thousands: ' ',
  270. decimal: ','
  271. },
  272. abbreviations: {
  273. thousand: ' tuh',
  274. million: ' mln',
  275. billion: ' mld',
  276. trillion: ' trl'
  277. },
  278. ordinal: function (number) {
  279. return '.';
  280. },
  281. currency: {
  282. symbol: '€'
  283. }
  284. });
  285. })();
  286. (function() {
  287. numeral.register('locale', 'fi', {
  288. delimiters: {
  289. thousands: ' ',
  290. decimal: ','
  291. },
  292. abbreviations: {
  293. thousand: 'k',
  294. million: 'M',
  295. billion: 'G',
  296. trillion: 'T'
  297. },
  298. ordinal: function (number) {
  299. return '.';
  300. },
  301. currency: {
  302. symbol: '€'
  303. }
  304. });
  305. })();
  306. (function() {
  307. numeral.register('locale', 'fr-ca', {
  308. delimiters: {
  309. thousands: ' ',
  310. decimal: ','
  311. },
  312. abbreviations: {
  313. thousand: 'k',
  314. million: 'M',
  315. billion: 'G',
  316. trillion: 'T'
  317. },
  318. ordinal : function (number) {
  319. return number === 1 ? 'er' : 'e';
  320. },
  321. currency: {
  322. symbol: '$'
  323. }
  324. });
  325. })();
  326. (function() {
  327. numeral.register('locale', 'fr-ch', {
  328. delimiters: {
  329. thousands: '\'',
  330. decimal: '.'
  331. },
  332. abbreviations: {
  333. thousand: 'k',
  334. million: 'm',
  335. billion: 'b',
  336. trillion: 't'
  337. },
  338. ordinal : function (number) {
  339. return number === 1 ? 'er' : 'e';
  340. },
  341. currency: {
  342. symbol: 'CHF'
  343. }
  344. });
  345. })();
  346. (function() {
  347. numeral.register('locale', 'fr', {
  348. delimiters: {
  349. thousands: ' ',
  350. decimal: ','
  351. },
  352. abbreviations: {
  353. thousand: 'k',
  354. million: 'm',
  355. billion: 'b',
  356. trillion: 't'
  357. },
  358. ordinal : function (number) {
  359. return number === 1 ? 'er' : 'e';
  360. },
  361. currency: {
  362. symbol: '€'
  363. }
  364. });
  365. })();
  366. (function() {
  367. numeral.register('locale', 'hu', {
  368. delimiters: {
  369. thousands: ' ',
  370. decimal: ','
  371. },
  372. abbreviations: {
  373. thousand: 'E', // ezer
  374. million: 'M', // millió
  375. billion: 'Mrd', // milliárd
  376. trillion: 'T' // trillió
  377. },
  378. ordinal: function (number) {
  379. return '.';
  380. },
  381. currency: {
  382. symbol: ' Ft'
  383. }
  384. });
  385. })();
  386. (function() {
  387. numeral.register('locale', 'it', {
  388. delimiters: {
  389. thousands: '.',
  390. decimal: ','
  391. },
  392. abbreviations: {
  393. thousand: 'mila',
  394. million: 'mil',
  395. billion: 'b',
  396. trillion: 't'
  397. },
  398. ordinal: function (number) {
  399. return 'º';
  400. },
  401. currency: {
  402. symbol: '€'
  403. }
  404. });
  405. })();
  406. (function() {
  407. numeral.register('locale', 'ja', {
  408. delimiters: {
  409. thousands: ',',
  410. decimal: '.'
  411. },
  412. abbreviations: {
  413. thousand: '千',
  414. million: '百万',
  415. billion: '十億',
  416. trillion: '兆'
  417. },
  418. ordinal: function (number) {
  419. return '.';
  420. },
  421. currency: {
  422. symbol: '¥'
  423. }
  424. });
  425. })();
  426. (function() {
  427. numeral.register('locale', 'lv', {
  428. delimiters: {
  429. thousands: ' ',
  430. decimal: ','
  431. },
  432. abbreviations: {
  433. thousand: ' tūkst.',
  434. million: ' milj.',
  435. billion: ' mljrd.',
  436. trillion: ' trilj.'
  437. },
  438. ordinal: function (number) {
  439. return '.';
  440. },
  441. currency: {
  442. symbol: '€'
  443. }
  444. });
  445. })();
  446. (function() {
  447. numeral.register('locale', 'nl-be', {
  448. delimiters: {
  449. thousands: ' ',
  450. decimal : ','
  451. },
  452. abbreviations: {
  453. thousand : 'k',
  454. million : ' mln',
  455. billion : ' mld',
  456. trillion : ' bln'
  457. },
  458. ordinal : function (number) {
  459. var remainder = number % 100;
  460. return (number !== 0 && remainder <= 1 || remainder === 8 || remainder >= 20) ? 'ste' : 'de';
  461. },
  462. currency: {
  463. symbol: '€ '
  464. }
  465. });
  466. })();
  467. (function() {
  468. numeral.register('locale', 'nl-nl', {
  469. delimiters: {
  470. thousands: '.',
  471. decimal : ','
  472. },
  473. abbreviations: {
  474. thousand : 'k',
  475. million : 'mln',
  476. billion : 'mrd',
  477. trillion : 'bln'
  478. },
  479. ordinal : function (number) {
  480. var remainder = number % 100;
  481. return (number !== 0 && remainder <= 1 || remainder === 8 || remainder >= 20) ? 'ste' : 'de';
  482. },
  483. currency: {
  484. symbol: '€ '
  485. }
  486. });
  487. })();
  488. (function() {
  489. numeral.register('locale', 'no', {
  490. delimiters: {
  491. thousands: ' ',
  492. decimal: ','
  493. },
  494. abbreviations: {
  495. thousand: 'k',
  496. million: 'm',
  497. billion: 'b',
  498. trillion: 't'
  499. },
  500. ordinal: function (number) {
  501. return '.';
  502. },
  503. currency: {
  504. symbol: 'kr'
  505. }
  506. });
  507. })();
  508. (function() {
  509. numeral.register('locale', 'pl', {
  510. delimiters: {
  511. thousands: ' ',
  512. decimal: ','
  513. },
  514. abbreviations: {
  515. thousand: 'tys.',
  516. million: 'mln',
  517. billion: 'mld',
  518. trillion: 'bln'
  519. },
  520. ordinal: function (number) {
  521. return '.';
  522. },
  523. currency: {
  524. symbol: 'PLN'
  525. }
  526. });
  527. })();
  528. (function() {
  529. numeral.register('locale', 'pt-br', {
  530. delimiters: {
  531. thousands: '.',
  532. decimal: ','
  533. },
  534. abbreviations: {
  535. thousand: 'mil',
  536. million: 'milhões',
  537. billion: 'b',
  538. trillion: 't'
  539. },
  540. ordinal: function (number) {
  541. return 'º';
  542. },
  543. currency: {
  544. symbol: 'R$'
  545. }
  546. });
  547. })();
  548. (function() {
  549. numeral.register('locale', 'pt-pt', {
  550. delimiters: {
  551. thousands: ' ',
  552. decimal: ','
  553. },
  554. abbreviations: {
  555. thousand: 'k',
  556. million: 'm',
  557. billion: 'b',
  558. trillion: 't'
  559. },
  560. ordinal : function (number) {
  561. return 'º';
  562. },
  563. currency: {
  564. symbol: '€'
  565. }
  566. });
  567. })();
  568. (function() {
  569. numeral.register('locale', 'ru-ua', {
  570. delimiters: {
  571. thousands: ' ',
  572. decimal: ','
  573. },
  574. abbreviations: {
  575. thousand: 'тыс.',
  576. million: 'млн',
  577. billion: 'b',
  578. trillion: 't'
  579. },
  580. ordinal: function () {
  581. // not ideal, but since in Russian it can taken on
  582. // different forms (masculine, feminine, neuter)
  583. // this is all we can do
  584. return '.';
  585. },
  586. currency: {
  587. symbol: '\u20B4'
  588. }
  589. });
  590. })();
  591. (function() {
  592. numeral.register('locale', 'ru', {
  593. delimiters: {
  594. thousands: ' ',
  595. decimal: ','
  596. },
  597. abbreviations: {
  598. thousand: 'тыс.',
  599. million: 'млн.',
  600. billion: 'млрд.',
  601. trillion: 'трлн.'
  602. },
  603. ordinal: function () {
  604. // not ideal, but since in Russian it can taken on
  605. // different forms (masculine, feminine, neuter)
  606. // this is all we can do
  607. return '.';
  608. },
  609. currency: {
  610. symbol: 'руб.'
  611. }
  612. });
  613. })();
  614. (function() {
  615. numeral.register('locale', 'sk', {
  616. delimiters: {
  617. thousands: ' ',
  618. decimal: ','
  619. },
  620. abbreviations: {
  621. thousand: 'tis.',
  622. million: 'mil.',
  623. billion: 'b',
  624. trillion: 't'
  625. },
  626. ordinal: function () {
  627. return '.';
  628. },
  629. currency: {
  630. symbol: '€'
  631. }
  632. });
  633. })();
  634. (function() {
  635. numeral.register('locale', 'sl', {
  636. delimiters: {
  637. thousands: '.',
  638. decimal: ','
  639. },
  640. abbreviations: {
  641. thousand: 'k',
  642. million: 'mio',
  643. billion: 'mrd',
  644. trillion: 'trilijon'
  645. },
  646. ordinal: function () {
  647. return '.';
  648. },
  649. currency: {
  650. symbol: '€'
  651. }
  652. });
  653. })();
  654. (function() {
  655. numeral.register('locale', 'th', {
  656. delimiters: {
  657. thousands: ',',
  658. decimal: '.'
  659. },
  660. abbreviations: {
  661. thousand: 'พัน',
  662. million: 'ล้าน',
  663. billion: 'พันล้าน',
  664. trillion: 'ล้านล้าน'
  665. },
  666. ordinal: function (number) {
  667. return '.';
  668. },
  669. currency: {
  670. symbol: '฿'
  671. }
  672. });
  673. })();
  674. (function() {
  675. var suffixes = {
  676. 1: '\'inci',
  677. 5: '\'inci',
  678. 8: '\'inci',
  679. 70: '\'inci',
  680. 80: '\'inci',
  681. 2: '\'nci',
  682. 7: '\'nci',
  683. 20: '\'nci',
  684. 50: '\'nci',
  685. 3: '\'üncü',
  686. 4: '\'üncü',
  687. 100: '\'üncü',
  688. 6: '\'ncı',
  689. 9: '\'uncu',
  690. 10: '\'uncu',
  691. 30: '\'uncu',
  692. 60: '\'ıncı',
  693. 90: '\'ıncı'
  694. };
  695. numeral.register('locale', 'tr', {
  696. delimiters: {
  697. thousands: '.',
  698. decimal: ','
  699. },
  700. abbreviations: {
  701. thousand: 'bin',
  702. million: 'milyon',
  703. billion: 'milyar',
  704. trillion: 'trilyon'
  705. },
  706. ordinal: function (number) {
  707. if (number === 0) { // special case for zero
  708. return '\'ıncı';
  709. }
  710. var a = number % 10,
  711. b = number % 100 - a,
  712. c = number >= 100 ? 100 : null;
  713. return suffixes[a] || suffixes[b] || suffixes[c];
  714. },
  715. currency: {
  716. symbol: '\u20BA'
  717. }
  718. });
  719. })();
  720. (function() {
  721. numeral.register('locale', 'uk-ua', {
  722. delimiters: {
  723. thousands: ' ',
  724. decimal: ','
  725. },
  726. abbreviations: {
  727. thousand: 'тис.',
  728. million: 'млн',
  729. billion: 'млрд',
  730. trillion: 'блн'
  731. },
  732. ordinal: function () {
  733. // not ideal, but since in Ukrainian it can taken on
  734. // different forms (masculine, feminine, neuter)
  735. // this is all we can do
  736. return '';
  737. },
  738. currency: {
  739. symbol: '\u20B4'
  740. }
  741. });
  742. })();
  743. (function() {
  744. numeral.register('locale', 'vi', {
  745. delimiters: {
  746. thousands: '.',
  747. decimal: ','
  748. },
  749. abbreviations: {
  750. thousand: ' nghìn',
  751. million: ' triệu',
  752. billion: ' tỷ',
  753. trillion: ' nghìn tỷ'
  754. },
  755. ordinal: function () {
  756. return '.';
  757. },
  758. currency: {
  759. symbol: '₫'
  760. }
  761. });
  762. })();
  763. }));