n2words 5.1.0 → 5.1.1
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/CHANGELOG.md +7 -0
- package/dist/am-ET.js +1 -1
- package/dist/am-ET.umd.js +1 -1
- package/dist/am-Latn-ET.js +1 -1
- package/dist/am-Latn-ET.umd.js +1 -1
- package/dist/ar-SA.js +1 -1
- package/dist/ar-SA.umd.js +1 -1
- package/dist/az-AZ.js +1 -1
- package/dist/az-AZ.umd.js +1 -1
- package/dist/bn-BD.js +1 -1
- package/dist/bn-BD.umd.js +1 -1
- package/dist/cs-CZ.js +1 -1
- package/dist/cs-CZ.umd.js +1 -1
- package/dist/da-DK.js +1 -1
- package/dist/da-DK.umd.js +1 -1
- package/dist/de-DE.js +1 -1
- package/dist/de-DE.umd.js +1 -1
- package/dist/el-GR.js +1 -1
- package/dist/el-GR.umd.js +1 -1
- package/dist/en-AU.js +1 -1
- package/dist/en-AU.umd.js +1 -1
- package/dist/en-BD.js +1 -1
- package/dist/en-BD.umd.js +1 -1
- package/dist/en-CA.js +1 -1
- package/dist/en-CA.umd.js +1 -1
- package/dist/en-GB.js +1 -1
- package/dist/en-GB.umd.js +1 -1
- package/dist/en-GH.js +1 -1
- package/dist/en-GH.umd.js +1 -1
- package/dist/en-IE.js +1 -1
- package/dist/en-IE.umd.js +1 -1
- package/dist/en-IN.js +1 -1
- package/dist/en-IN.umd.js +1 -1
- package/dist/en-KE.js +1 -1
- package/dist/en-KE.umd.js +1 -1
- package/dist/en-MY.js +1 -1
- package/dist/en-MY.umd.js +1 -1
- package/dist/en-NG.js +1 -1
- package/dist/en-NG.umd.js +1 -1
- package/dist/en-NZ.js +1 -1
- package/dist/en-NZ.umd.js +1 -1
- package/dist/en-PH.js +1 -1
- package/dist/en-PH.umd.js +1 -1
- package/dist/en-PK.js +1 -1
- package/dist/en-PK.umd.js +1 -1
- package/dist/en-SG.js +1 -1
- package/dist/en-SG.umd.js +1 -1
- package/dist/en-US.js +1 -1
- package/dist/en-US.umd.js +1 -1
- package/dist/en-ZA.js +1 -1
- package/dist/en-ZA.umd.js +1 -1
- package/dist/es-ES.js +1 -1
- package/dist/es-ES.umd.js +1 -1
- package/dist/es-MX.js +1 -1
- package/dist/es-MX.umd.js +1 -1
- package/dist/es-US.js +1 -1
- package/dist/es-US.umd.js +1 -1
- package/dist/fa-IR.js +1 -1
- package/dist/fa-IR.umd.js +1 -1
- package/dist/fi-FI.js +1 -1
- package/dist/fi-FI.umd.js +1 -1
- package/dist/fil-PH.js +1 -1
- package/dist/fil-PH.umd.js +1 -1
- package/dist/fr-BE.js +1 -1
- package/dist/fr-BE.umd.js +1 -1
- package/dist/fr-FR.js +1 -1
- package/dist/fr-FR.umd.js +1 -1
- package/dist/gu-IN.js +1 -1
- package/dist/gu-IN.umd.js +1 -1
- package/dist/ha-NG.js +1 -1
- package/dist/ha-NG.umd.js +1 -1
- package/dist/hbo-IL.js +1 -1
- package/dist/hbo-IL.umd.js +1 -1
- package/dist/he-IL.js +1 -1
- package/dist/he-IL.umd.js +1 -1
- package/dist/hi-IN.js +1 -1
- package/dist/hi-IN.umd.js +1 -1
- package/dist/hr-HR.js +1 -1
- package/dist/hr-HR.umd.js +1 -1
- package/dist/hu-HU.js +1 -1
- package/dist/hu-HU.umd.js +1 -1
- package/dist/id-ID.js +1 -1
- package/dist/id-ID.umd.js +1 -1
- package/dist/it-IT.js +1 -1
- package/dist/it-IT.umd.js +1 -1
- package/dist/ja-JP.js +1 -1
- package/dist/ja-JP.umd.js +1 -1
- package/dist/ka-GE.js +1 -1
- package/dist/ka-GE.umd.js +1 -1
- package/dist/kn-IN.js +1 -1
- package/dist/kn-IN.umd.js +1 -1
- package/dist/ko-KR.js +1 -1
- package/dist/ko-KR.umd.js +1 -1
- package/dist/lt-LT.js +1 -1
- package/dist/lt-LT.umd.js +1 -1
- package/dist/lv-LV.js +1 -1
- package/dist/lv-LV.umd.js +1 -1
- package/dist/mr-IN.js +1 -1
- package/dist/mr-IN.umd.js +1 -1
- package/dist/ms-MY.js +1 -1
- package/dist/ms-MY.umd.js +1 -1
- package/dist/nb-NO.js +1 -1
- package/dist/nb-NO.umd.js +1 -1
- package/dist/nl-NL.js +1 -1
- package/dist/nl-NL.umd.js +1 -1
- package/dist/pa-IN.js +1 -1
- package/dist/pa-IN.umd.js +1 -1
- package/dist/pl-PL.js +1 -1
- package/dist/pl-PL.umd.js +1 -1
- package/dist/pt-BR.js +1 -1
- package/dist/pt-BR.umd.js +1 -1
- package/dist/pt-PT.js +1 -1
- package/dist/pt-PT.umd.js +1 -1
- package/dist/ro-RO.js +1 -1
- package/dist/ro-RO.umd.js +1 -1
- package/dist/ru-RU.js +1 -1
- package/dist/ru-RU.umd.js +1 -1
- package/dist/sr-Cyrl-RS.js +2 -2
- package/dist/sr-Cyrl-RS.umd.js +2 -2
- package/dist/sr-Latn-RS.js +2 -2
- package/dist/sr-Latn-RS.umd.js +2 -2
- package/dist/sv-SE.js +1 -1
- package/dist/sv-SE.umd.js +1 -1
- package/dist/sw-KE.js +1 -1
- package/dist/sw-KE.umd.js +1 -1
- package/dist/ta-IN.js +1 -1
- package/dist/ta-IN.umd.js +1 -1
- package/dist/te-IN.js +1 -1
- package/dist/te-IN.umd.js +1 -1
- package/dist/th-TH.js +1 -1
- package/dist/th-TH.umd.js +1 -1
- package/dist/tr-TR.js +1 -1
- package/dist/tr-TR.umd.js +1 -1
- package/dist/uk-UA.js +1 -1
- package/dist/uk-UA.umd.js +1 -1
- package/dist/ur-PK.js +1 -1
- package/dist/ur-PK.umd.js +1 -1
- package/dist/vi-VN.js +1 -1
- package/dist/vi-VN.umd.js +1 -1
- package/dist/yo-NG.js +1 -1
- package/dist/yo-NG.umd.js +1 -1
- package/dist/zh-Hans-CN.js +1 -1
- package/dist/zh-Hans-CN.umd.js +1 -1
- package/dist/zh-Hant-TW.js +1 -1
- package/dist/zh-Hant-TW.umd.js +1 -1
- package/package.json +13 -13
- package/src/sr-Cyrl-RS.js +6 -5
- package/src/sr-Latn-RS.js +6 -5
package/dist/kn-IN.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/kn-IN v5.1.
|
|
1
|
+
/*! n2words/kn-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3+2*(e-1))}const u="ಸೊನ್ನೆ",a="ಋಣಾತ್ಮಕ",c="ನೂರು",g=["","ಮೊದಲನೇ","ಎರಡನೇ","ಮೂರನೇ","ನಾಲ್ಕನೇ","ಐದನೇ","ಆರನೇ"],f=["ಸೊನ್ನೆ","ಒಂದು","ಎರಡು","ಮೂರು","ನಾಲ್ಕು","ಐದು","ಆರು","ಏಳು","ಎಂಟು","ಒಂಬತ್ತು","ಹತ್ತು","ಹನ್ನೊಂದು","ಹನ್ನೆರಡು","ಹದಿಮೂರು","ಹದಿನಾಲ್ಕು","ಹದಿನೈದು","ಹದಿನಾರು","ಹದಿನೇಳು","ಹದಿನೆಂಟು","ಹತ್ತೊಂಬತ್ತು","ಇಪ್ಪತ್ತು","ಇಪ್ಪತ್ತೊಂದು","ಇಪ್ಪತ್ತೆರಡು","ಇಪ್ಪತ್ತಮೂರು","ಇಪ್ಪತ್ತನಾಲ್ಕು","ಇಪ್ಪತ್ತೈದು","ಇಪ್ಪತ್ತಾರು","ಇಪ್ಪತ್ತೇಳು","ಇಪ್ಪತ್ತೆಂಟು","ಇಪ್ಪತ್ತೊಂಬತ್ತು","ಮೂವತ್ತು","ಮೂವತ್ತೊಂದು","ಮೂವತ್ತೆರಡು","ಮೂವತ್ತಮೂರು","ಮೂವತ್ತನಾಲ್ಕು","ಮೂವತ್ತೈದು","ಮೂವತ್ತಾರು","ಮೂವತ್ತೇಳು","ಮೂವತ್ತೆಂಟು","ಮೂವತ್ತೊಂಬತ್ತು","ನಲವತ್ತು","ನಲವತ್ತೊಂದು","ನಲವತ್ತೆರಡು","ನಲವತ್ತಮೂರು","ನಲವತ್ತನಾಲ್ಕು","ನಲವತ್ತೈದು","ನಲವತ್ತಾರು","ನಲವತ್ತೇಳು","ನಲವತ್ತೆಂಟು","ನಲವತ್ತೊಂಬತ್ತು","ಐವತ್ತು","ಐವತ್ತೊಂದು","ಐವತ್ತೆರಡು","ಐವತ್ತಮೂರು","ಐವತ್ತನಾಲ್ಕು","ಐವತ್ತೈದು","ಐವತ್ತಾರು","ಐವತ್ತೇಳು","ಐವತ್ತೆಂಟು","ಐವತ್ತೊಂಬತ್ತು","ಅರವತ್ತು","ಅರವತ್ತೊಂದು","ಅರವತ್ತೆರಡು","ಅರವತ್ತಮೂರು","ಅರವತ್ತನಾಲ್ಕು","ಅರವತ್ತೈದು","ಅರವತ್ತಾರು","ಅರವತ್ತೇಳು","ಅರವತ್ತೆಂಟು","ಅರವತ್ತೊಂಬತ್ತು","ಎಪ್ಪತ್ತು","ಎಪ್ಪತ್ತೊಂದು","ಎಪ್ಪತ್ತೆರಡು","ಎಪ್ಪತ್ತಮೂರು","ಎಪ್ಪತ್ತನಾಲ್ಕು","ಎಪ್ಪತ್ತೈದು","ಎಪ್ಪತ್ತಾರು","ಎಪ್ಪತ್ತೇಳು","ಎಪ್ಪತ್ತೆಂಟು","ಎಪ್ಪತ್ತೊಂಬತ್ತು","ಎಂಬತ್ತು","ಎಂಬತ್ತೊಂದು","ಎಂಬತ್ತೆರಡು","ಎಂಬತ್ತಮೂರು","ಎಂಬತ್ತನಾಲ್ಕು","ಎಂಬತ್ತೈದು","ಎಂಬತ್ತಾರು","ಎಂಬತ್ತೇಳು","ಎಂಬತ್ತೆಂಟು","ಎಂಬತ್ತೊಂಬತ್ತು","ತೊಂಬತ್ತು","ತೊಂಬತ್ತೊಂದು","ತೊಂಬತ್ತೆರಡು","ತೊಂಬತ್ತಮೂರು","ತೊಂಬತ್ತನಾಲ್ಕು","ತೊಂಬತ್ತೈದು","ತೊಂಬತ್ತಾರು","ತೊಂಬತ್ತೇಳು","ತೊಂಬತ್ತೆಂಟು","ತೊಂಬತ್ತೊಂಬತ್ತು"],l=["","ಸಾವಿರ","ಲಕ್ಷ","ಕೋಟಿ","ಅಬ್ಜ","ಖರ್ವ","ನೀಲ","ಪದ್ಮ","ಶಂಖ"],m=s(l.length),b=s(l.length),w=s(l.length);function d(e){if(0===e)return"";if(e<100)return f[e];const n=Math.trunc(e/100),t=e%100;return 0===t?f[n]+" "+c:f[n]+" "+c+" "+f[t]}function h(e){if(0n===e)return u;if(e<1000n)return d(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?d(t):f[t]),e>0&&l[e]&&r.push(l[e]))}return r.join(" ")}function p(i){const{isNegative:s,integerPart:c,decimalPart:g}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(c,m);let l="";return s&&(l=a+" "),l+=h(c),g&&(l+=" ದಶಮಾಂಶ "+function(e){const n=[];for(const t of e){const e=parseInt(t,10);n.push(0===e?u:f[e])}return n.join(" ")}(g)),l}function N(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,b),(i=r)>=1n&&i<=6n?g[Number(i)]:h(i)+"ನೇ";var i}function v(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,w);let u="";return t&&(u=a+" "),(r>0n||0n===s)&&(u+=h(r),u+=" "+(1n===r?"ರೂಪಾಯಿ":"ರೂಪಾಯಿಗಳು")),s>0n&&(r>0n&&(u+=" "),u+=h(s),u+=" "+(1n===s?"ಪೈಸೆ":"ಪೈಸೆಗಳು")),u}export{m as cardinalMax,w as currencyMax,b as ordinalMax,p as toCardinal,v as toCurrency,N as toOrdinal};
|
package/dist/kn-IN.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/kn-IN v5.1.
|
|
1
|
+
/*! n2words/kn-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3+2*(e-1))}const a="ಸೊನ್ನೆ",c="ಋಣಾತ್ಮಕ",f="ನೂರು",g=["","ಮೊದಲನೇ","ಎರಡನೇ","ಮೂರನೇ","ನಾಲ್ಕನೇ","ಐದನೇ","ಆರನೇ"],l=["ಸೊನ್ನೆ","ಒಂದು","ಎರಡು","ಮೂರು","ನಾಲ್ಕು","ಐದು","ಆರು","ಏಳು","ಎಂಟು","ಒಂಬತ್ತು","ಹತ್ತು","ಹನ್ನೊಂದು","ಹನ್ನೆರಡು","ಹದಿಮೂರು","ಹದಿನಾಲ್ಕು","ಹದಿನೈದು","ಹದಿನಾರು","ಹದಿನೇಳು","ಹದಿನೆಂಟು","ಹತ್ತೊಂಬತ್ತು","ಇಪ್ಪತ್ತು","ಇಪ್ಪತ್ತೊಂದು","ಇಪ್ಪತ್ತೆರಡು","ಇಪ್ಪತ್ತಮೂರು","ಇಪ್ಪತ್ತನಾಲ್ಕು","ಇಪ್ಪತ್ತೈದು","ಇಪ್ಪತ್ತಾರು","ಇಪ್ಪತ್ತೇಳು","ಇಪ್ಪತ್ತೆಂಟು","ಇಪ್ಪತ್ತೊಂಬತ್ತು","ಮೂವತ್ತು","ಮೂವತ್ತೊಂದು","ಮೂವತ್ತೆರಡು","ಮೂವತ್ತಮೂರು","ಮೂವತ್ತನಾಲ್ಕು","ಮೂವತ್ತೈದು","ಮೂವತ್ತಾರು","ಮೂವತ್ತೇಳು","ಮೂವತ್ತೆಂಟು","ಮೂವತ್ತೊಂಬತ್ತು","ನಲವತ್ತು","ನಲವತ್ತೊಂದು","ನಲವತ್ತೆರಡು","ನಲವತ್ತಮೂರು","ನಲವತ್ತನಾಲ್ಕು","ನಲವತ್ತೈದು","ನಲವತ್ತಾರು","ನಲವತ್ತೇಳು","ನಲವತ್ತೆಂಟು","ನಲವತ್ತೊಂಬತ್ತು","ಐವತ್ತು","ಐವತ್ತೊಂದು","ಐವತ್ತೆರಡು","ಐವತ್ತಮೂರು","ಐವತ್ತನಾಲ್ಕು","ಐವತ್ತೈದು","ಐವತ್ತಾರು","ಐವತ್ತೇಳು","ಐವತ್ತೆಂಟು","ಐವತ್ತೊಂಬತ್ತು","ಅರವತ್ತು","ಅರವತ್ತೊಂದು","ಅರವತ್ತೆರಡು","ಅರವತ್ತಮೂರು","ಅರವತ್ತನಾಲ್ಕು","ಅರವತ್ತೈದು","ಅರವತ್ತಾರು","ಅರವತ್ತೇಳು","ಅರವತ್ತೆಂಟು","ಅರವತ್ತೊಂಬತ್ತು","ಎಪ್ಪತ್ತು","ಎಪ್ಪತ್ತೊಂದು","ಎಪ್ಪತ್ತೆರಡು","ಎಪ್ಪತ್ತಮೂರು","ಎಪ್ಪತ್ತನಾಲ್ಕು","ಎಪ್ಪತ್ತೈದು","ಎಪ್ಪತ್ತಾರು","ಎಪ್ಪತ್ತೇಳು","ಎಪ್ಪತ್ತೆಂಟು","ಎಪ್ಪತ್ತೊಂಬತ್ತು","ಎಂಬತ್ತು","ಎಂಬತ್ತೊಂದು","ಎಂಬತ್ತೆರಡು","ಎಂಬತ್ತಮೂರು","ಎಂಬತ್ತನಾಲ್ಕು","ಎಂಬತ್ತೈದು","ಎಂಬತ್ತಾರು","ಎಂಬತ್ತೇಳು","ಎಂಬತ್ತೆಂಟು","ಎಂಬತ್ತೊಂಬತ್ತು","ತೊಂಬತ್ತು","ತೊಂಬತ್ತೊಂದು","ತೊಂಬತ್ತೆರಡು","ತೊಂಬತ್ತಮೂರು","ತೊಂಬತ್ತನಾಲ್ಕು","ತೊಂಬತ್ತೈದು","ತೊಂಬತ್ತಾರು","ತೊಂಬತ್ತೇಳು","ತೊಂಬತ್ತೆಂಟು","ತೊಂಬತ್ತೊಂಬತ್ತು"],d=["","ಸಾವಿರ","ಲಕ್ಷ","ಕೋಟಿ","ಅಬ್ಜ","ಖರ್ವ","ನೀಲ","ಪದ್ಮ","ಶಂಖ"],b=u(d.length),m=u(d.length),p=u(d.length);function h(e){if(0===e)return"";if(e<100)return l[e];const n=Math.trunc(e/100),t=e%100;return 0===t?l[n]+" "+f:l[n]+" "+f+" "+l[t]}function w(e){if(0n===e)return a;if(e<1000n)return h(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?h(t):l[t]),e>0&&d[e]&&r.push(d[e]))}return r.join(" ")}const N={knIN:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,m),(i=t)>=1n&&i<=6n?g[Number(i)]:w(i)+"ನೇ";var i}};e.currency={knIN:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,p);let u="";return n&&(u=c+" "),(r>0n||0n===i)&&(u+=w(r),u+=" "+(1n===r?"ರೂಪಾಯಿ":"ರೂಪಾಯಿಗಳು")),i>0n&&(r>0n&&(u+=" "),u+=w(i),u+=" "+(1n===i?"ಪೈಸೆ":"ಪೈಸೆಗಳು")),u}},e.knIN=function(e){const{isNegative:o,integerPart:u,decimalPart:f}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,b);let g="";return o&&(g=c+" "),g+=w(u),f&&(g+=" ದಶಮಾಂಶ "+function(e){const n=[];for(const t of e){const e=parseInt(t,10);n.push(0===e?a:l[e])}return n.join(" ")}(f)),g},e.ordinal=N},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
|
package/dist/ko-KR.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/ko-KR v5.1.
|
|
1
|
+
/*! n2words/ko-KR v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const s=n.indexOf("."),o=-1===s?n:n.slice(0,s)+n.slice(s+1),u=(-1===s?n.length:s)+r;return u>=o.length?i+o+"0".repeat(u-o.length):u<=0?i+"0."+"0".repeat(-u)+o:i+o.slice(0,u)+"."+o.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const s=r.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(r),cents:0n};const o=r.slice(0,s)||"0",u=(r.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(o),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function o(e){return 10n**BigInt(4*(e+1))}const u=["","일","이","삼","사","오","육","칠","팔","구"],c="마이너스",a=["만","억","조","경","해","자","양"],l=o(a.length),g=o(a.length),f=o(a.length);function h(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100)%10,i=Math.trunc(e/1e3);let s="";return i>0&&(s+=1===i?"천":u[i]+"천"),r>0&&(s+=1===r?"백":u[r]+"백"),t>0&&(s+=1===t?"십":u[t]+"십"),n>0&&(s+=u[n]),s}function p(e){return 0n===e?"영":e<10000n?h(Number(e)):function(e){const n=e.toString(),t=n.length,r=[],i=t%4;let s=0;for(i>0&&(r.push(Number(n.slice(0,i))),s=i);s<t;)r.push(Number(n.slice(s,s+4))),s+=4;const o=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===u)o.push({word:h(n),isScale:!1});else{const e=a[u-1];1===n||o.push({word:h(n),isScale:!1}),o.push({word:e,isScale:!0})}u--}return function(e){if(0===e.length)return"영";if(1===e.length)return e[0].word;const n=[];for(let t=0;t<e.length;t++){const r=e[t],i=t>0?e[t-1]:null;i&&i.isScale&&!r.isScale&&n.push(" "),n.push(r.word)}return n.join("")}(o)}(e)}function w(i){const{isNegative:o,integerPart:u,decimalPart:a}=function(i){const s=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(i);s(u,l,a);const g=[];return o&&g.push(c),g.push(p(u)),a&&(g.push("점"),g.push(function(e){const n=[];let t=0;for(;t<e.length&&"0"===e[t];)n.push("영"),t++;const r=e.slice(t);return r&&n.push(p(BigInt(r))),n.join(" ")}(a))),g.join(" ")}function d(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return s(r,g),"제"+p(r)}function m(e){const{isNegative:t,dollars:r}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);s(r,f);let o="";return t&&(o=c+" "),o+=p(r),o+="원",o}export{l as cardinalMax,f as currencyMax,g as ordinalMax,w as toCardinal,m as toCurrency,d as toOrdinal};
|
package/dist/ko-KR.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/ko-KR v5.1.
|
|
1
|
+
/*! n2words/ko-KR v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(4*(e+1))}const c=["","일","이","삼","사","오","육","칠","팔","구"],a="마이너스",l=["만","억","조","경","해","자","양"],g=u(l.length),f=u(l.length),h=u(l.length);function d(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100)%10,i=Math.trunc(e/1e3);let o="";return i>0&&(o+=1===i?"천":c[i]+"천"),r>0&&(o+=1===r?"백":c[r]+"백"),t>0&&(o+=1===t?"십":c[t]+"십"),n>0&&(o+=c[n]),o}function p(e){return 0n===e?"영":e<10000n?d(Number(e)):function(e){const n=e.toString(),t=n.length,r=[],i=t%4;let o=0;for(i>0&&(r.push(Number(n.slice(0,i))),o=i);o<t;)r.push(Number(n.slice(o,o+4))),o+=4;const s=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===u)s.push({word:d(n),isScale:!1});else{const e=l[u-1];1===n||s.push({word:d(n),isScale:!1}),s.push({word:e,isScale:!0})}u--}return function(e){if(0===e.length)return"영";if(1===e.length)return e[0].word;const n=[];for(let t=0;t<e.length;t++){const r=e[t],i=t>0?e[t-1]:null;i&&i.isScale&&!r.isScale&&n.push(" "),n.push(r.word)}return n.join("")}(s)}(e)}const w={koKR:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,f),"제"+p(t)}};e.currency={koKR:function(e){const{isNegative:n,dollars:r}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,h);let i="";return n&&(i=a+" "),i+=p(r),i+="원",i}},e.koKR=function(e){const{isNegative:o,integerPart:u,decimalPart:c}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,g,c);const l=[];return o&&l.push(a),l.push(p(u)),c&&(l.push("점"),l.push(function(e){const n=[];let t=0;for(;t<e.length&&"0"===e[t];)n.push("영"),t++;const r=e.slice(t);return r&&n.push(p(BigInt(r))),n.join(" ")}(c))),l.join(" ")},e.ordinal=w},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
|
package/dist/lt-LT.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/lt-LT v5.1.
|
|
1
|
+
/*! n2words/lt-LT v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function t(t){let[e,i]=t.toLowerCase().split("e");const n=parseInt(i,10);let r="";"-"===e[0]&&(r="-",e=e.slice(1));const s=e.indexOf("."),o=-1===s?e:e.slice(0,s)+e.slice(s+1),a=(-1===s?e.length:s)+n;return a>=o.length?r+o+"0".repeat(a-o.length):a<=0?r+"0."+"0".repeat(-a)+o:r+o.slice(0,a)+"."+o.slice(a)}function e(e){const n=e.toString();return i(n)?t(n):n}function i(t){return t.includes("e")||t.includes("E")}function n(t){const e="-"===t[0];e&&(t=t.slice(1));const i=t.indexOf(".");if(-1===i)return{isNegative:e,integerPart:BigInt(t)};const n=t.slice(0,i)||"0",r=t.slice(i+1);return{isNegative:e,integerPart:BigInt(n),decimalPart:r}}function r(e){let n=e.trim();if(0===n.length||Number.isNaN(Number(n)))throw new RangeError(`Invalid currency format: "${e}"`);i(n)&&(n=t(n));const r="-"===n[0];r&&(n=n.slice(1));const s=n.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(n),cents:0n};const o=n.slice(0,s)||"0",a=(n.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(a)}}function s(t,e,i){if(null===e)return;if(t<e&&!(i&&BigInt(i)>=e))return;const n=e.toString().length-1,r=e===10n**BigInt(n)?`10^${n} - 1`:""+(e-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function o(t){return 10n**BigInt(3*(t+1))}const a=["","vienas","du","trys","keturi","penki","šeši","septyni","aštuoni","devyni"],u=["","viena","dvi","trys","keturios","penkios","šešios","septynios","aštuonios","devynios"],l=["dešimt","vienuolika","dvylika","trylika","keturiolika","penkiolika","šešiolika","septyniolika","aštuoniolika","devyniolika"],c=["","","dvidešimt","trisdešimt","keturiasdešimt","penkiasdešimt","šešiasdešimt","septyniasdešimt","aštuoniasdešimt","devyniasdešimt"],f="šimtas",g="šimtai",m="nulis",d="minus",p=["","pirmas","antras","trečias","ketvirtas","penktas","šeštas","septintas","aštuntas","devintas"],h=["dešimtas","vienuoliktas","dvyliktas","tryliktas","keturioliktas","penkioliktas","šešioliktas","septynioliktas","aštuonioliktas","devynioliktas"],b=["","","dvidešimtas","trisdešimtas","keturiasdešimtas","penkiasdešimtas","šešiasdešimtas","septyniasdešimtas","aštuoniasdešimtas","devyniasdešimtas"],v=["","šimtasis","dviejų šimtasis","trijų šimtasis","keturių šimtasis","penkių šimtasis","šešių šimtasis","septynių šimtasis","aštuonių šimtasis","devynių šimtasis"],y=["tūkstantasis","milijonasis","milijardasis","trilijonasis"],w=["euras","eurai","eurų"],k=["centas","centai","centų"],N=[["tūkstantis","tūkstančiai","tūkstančių"],["milijonas","milijonai","milijonų"],["milijardas","milijardai","milijardų"],["trilijonas","trilijonai","trilijonų"],["kvadrilijonas","kvadrilijonai","kvadrilijonų"],["kvintilijonas","kvintilijonai","kvintilijonų"],["sikstilijonas","sikstilijonai","sikstilijonų"],["septilijonas","septilijonai","septilijonų"],["oktilijonas","oktilijonai","oktilijonų"]],j=o(N.length),I=o(y.length),E=o(N.length);function O(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10)%10,n=Math.trunc(t/100),r=[];return n>0&&(r.push(a[n]),r.push(1===n?f:g)),i>1&&r.push(c[i]),1===i?r.push(l[e]):e>0&&r.push(a[e]),r.join(" ")}function B(t,e){if(0===t)return e[2];const i=t%10,n=t%100;return n>=10&&n<=19||0===i?e[2]:1===i?e[0]:e[1]}function R(t,e){if(0n===t)return m;if(t<1000n){const i=Number(t);return"feminine"===e?function(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10)%10,n=Math.trunc(t/100),r=[];return n>0&&(r.push(a[n]),r.push(1===n?f:g)),i>1&&r.push(c[i]),1===i?r.push(l[e]):e>0&&r.push(u[e]),r.join(" ")}(i):O(i)}return function(t){const e=t.toString(),i=e.length,n=[],r=i%3;let s=0;for(r>0&&(n.push(Number(e.slice(0,r))),s=r);s<i;)n.push(Number(e.slice(s,s+3))),s+=3;const o=[];let a=n.length-1;for(let t=0;t<n.length;t++){const e=n[t];if(0!==e){const t=O(e);if(0===a)o.push(t);else{const i=B(e,N[a-1]);o.push(t+" "+i)}}a--}return o.join(" ")}(t)}const $={gender:"masculine"},P={gender:["masculine","feminine"]};function x(r,o){const{isNegative:a,integerPart:u,decimalPart:l}=function(r){const s=typeof r;if("bigint"==typeof r)return r<0n?{isNegative:!0,integerPart:-r}:{isNegative:!1,integerPart:r};if("number"==typeof r){if(!Number.isFinite(r))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(r)?r<0?{isNegative:!0,integerPart:BigInt(-r)}:{isNegative:!1,integerPart:BigInt(r)}:n(e(r))}if("string"==typeof r)return n(function(e){const n=e.trim();if(0===n.length||Number.isNaN(Number(n)))throw new RangeError(`Invalid number format: "${e}"`);return i(n)?t(n):n}(r));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(r);s(u,j,l);const{gender:c}=function(t,e,i){const n={...e};if(void 0===t)return n;if(!function(t){if(null===t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}(t))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof t);const r=Object.keys(e);for(const[s,o]of Object.entries(t)){if(!Object.hasOwn(e,s))throw new TypeError(`Unknown option "${s}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof n[s])throw new TypeError(`Option "${s}" must be a ${typeof n[s]}, got ${typeof o}`);if(void 0!==i&&Object.hasOwn(i,s)){const t=i[s];if(!t.includes(o))throw new RangeError(`Option "${s}" must be one of: ${t.join(", ")} — got ${JSON.stringify(o)}`)}n[s]=o}}return n}(o,$,P);let f="";return a&&(f=d+" "),f+=R(u,c),l&&(f+=" kablelis "+function(t,e){let i="",n=0;for(;n<t.length&&"0"===t[n];)i&&(i+=" "),i+=m,n++;const r=t.slice(n);return r&&(i&&(i+=" "),i+=R(BigInt(r),e)),i}(l,c)),f}function S(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10);return 0===i?p[e]:1===i?h[e]:0===e?b[i]:c[i]+" "+p[e]}function M(t){if(t<100n)return S(Number(t));if(t<1000n){const e=Number(t),i=Math.trunc(e/100),n=e%100;return 0===n?v[i]:a[i]+" "+(1===i?f:g)+" "+S(n)}if(t<1000000n){const e=Number(t/1000n),i=Number(t%1000n);if(0===i){if(1===e)return y[0];const t=B(e,N[0]);return O(e)+" "+t+" "+y[0]}const n=B(e,N[0]);return O(e)+" "+n+" "+M(BigInt(i))}return function(t){const e=t.toString(),i=e.length,n=[],r=i%3;let s=0;for(r>0&&(n.push(Number(e.slice(0,r))),s=r);s<i;)n.push(Number(e.slice(s,s+3))),s+=3;let o=n.length-1;for(;o>=0&&0===n[o];)o--;const a=[];let u=n.length-1;for(let t=0;t<n.length;t++){const e=n[t];if(0!==e){const i=t===o;if(0===u)a.push(i?M(BigInt(e)):O(e));else if(i)if(1===e)a.push(y[u-1]);else{const t=B(e,N[u-1]);a.push(O(e)+" "+t+" "+y[u-1])}else{const t=B(e,N[u-1]);a.push(O(e)+" "+t)}}u--}return a.join(" ")}(t)}function T(e){const n=function(e){const n=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const n=e.trim();if(0===n.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===n[0])throw new RangeError("Ordinals cannot be negative");if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");if(i(n)){const e=t(n);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const i=BigInt(e);if(i<=0n)throw new RangeError("Ordinals must be positive integers");return i}try{const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}catch(t){if(t instanceof RangeError)throw t;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:t})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);return s(n,I),M(n)}function F(t){const{isNegative:i,dollars:n,cents:o}=function(t){const i=typeof t;if("bigint"==typeof t)return t<0n?{isNegative:!0,dollars:-t,cents:0n}:{isNegative:!1,dollars:t,cents:0n};if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(t)?t<0?{isNegative:!0,dollars:BigInt(-t),cents:0n}:{isNegative:!1,dollars:BigInt(t),cents:0n}:r(e(t))}if("string"==typeof t)return r(t);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${i}`)}(t);s(n,E);let a="";return i&&(a=d+" "),(n>0n||0n===o)&&(a+=R(n,"masculine"),a+=" "+B(Number(n),w)),o>0n&&(n>0n&&(a+=" "),a+=R(o,"masculine"),a+=" "+B(Number(o),k)),a}export{$ as cardinalDefaults,j as cardinalMax,P as cardinalValues,E as currencyMax,I as ordinalMax,x as toCardinal,F as toCurrency,T as toOrdinal};
|
package/dist/lt-LT.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/lt-LT v5.1.
|
|
1
|
+
/*! n2words/lt-LT v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var t,e;t=this,e=function(t){"use strict";function e(t){let[e,i]=t.toLowerCase().split("e");const n=parseInt(i,10);let r="";"-"===e[0]&&(r="-",e=e.slice(1));const s=e.indexOf("."),o=-1===s?e:e.slice(0,s)+e.slice(s+1),a=(-1===s?e.length:s)+n;return a>=o.length?r+o+"0".repeat(a-o.length):a<=0?r+"0."+"0".repeat(-a)+o:r+o.slice(0,a)+"."+o.slice(a)}function i(t){const i=t.toString();return n(i)?e(i):i}function n(t){return t.includes("e")||t.includes("E")}function r(t){const e="-"===t[0];e&&(t=t.slice(1));const i=t.indexOf(".");if(-1===i)return{isNegative:e,integerPart:BigInt(t)};const n=t.slice(0,i)||"0",r=t.slice(i+1);return{isNegative:e,integerPart:BigInt(n),decimalPart:r}}function s(t){let i=t.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid currency format: "${t}"`);n(i)&&(i=e(i));const r="-"===i[0];r&&(i=i.slice(1));const s=i.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(i),cents:0n};const o=i.slice(0,s)||"0",a=(i.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(a)}}function o(t,e,i){if(null===e)return;if(t<e&&!(i&&BigInt(i)>=e))return;const n=e.toString().length-1,r=e===10n**BigInt(n)?`10^${n} - 1`:""+(e-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function a(t){return 10n**BigInt(3*(t+1))}const u=["","vienas","du","trys","keturi","penki","šeši","septyni","aštuoni","devyni"],l=["","viena","dvi","trys","keturios","penkios","šešios","septynios","aštuonios","devynios"],c=["dešimt","vienuolika","dvylika","trylika","keturiolika","penkiolika","šešiolika","septyniolika","aštuoniolika","devyniolika"],f=["","","dvidešimt","trisdešimt","keturiasdešimt","penkiasdešimt","šešiasdešimt","septyniasdešimt","aštuoniasdešimt","devyniasdešimt"],g="šimtas",d="šimtai",m="nulis",p="minus",h=["","pirmas","antras","trečias","ketvirtas","penktas","šeštas","septintas","aštuntas","devintas"],b=["dešimtas","vienuoliktas","dvyliktas","tryliktas","keturioliktas","penkioliktas","šešioliktas","septynioliktas","aštuonioliktas","devynioliktas"],v=["","","dvidešimtas","trisdešimtas","keturiasdešimtas","penkiasdešimtas","šešiasdešimtas","septyniasdešimtas","aštuoniasdešimtas","devyniasdešimtas"],y=["","šimtasis","dviejų šimtasis","trijų šimtasis","keturių šimtasis","penkių šimtasis","šešių šimtasis","septynių šimtasis","aštuonių šimtasis","devynių šimtasis"],w=["tūkstantasis","milijonasis","milijardasis","trilijonasis"],k=["euras","eurai","eurų"],j=["centas","centai","centų"],N=[["tūkstantis","tūkstančiai","tūkstančių"],["milijonas","milijonai","milijonų"],["milijardas","milijardai","milijardų"],["trilijonas","trilijonai","trilijonų"],["kvadrilijonas","kvadrilijonai","kvadrilijonų"],["kvintilijonas","kvintilijonai","kvintilijonų"],["sikstilijonas","sikstilijonai","sikstilijonų"],["septilijonas","septilijonai","septilijonų"],["oktilijonas","oktilijonai","oktilijonų"]],I=a(N.length),E=a(w.length),O=a(N.length);function B(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10)%10,n=Math.trunc(t/100),r=[];return n>0&&(r.push(u[n]),r.push(1===n?g:d)),i>1&&r.push(f[i]),1===i?r.push(c[e]):e>0&&r.push(u[e]),r.join(" ")}function R(t,e){if(0===t)return e[2];const i=t%10,n=t%100;return n>=10&&n<=19||0===i?e[2]:1===i?e[0]:e[1]}function $(t,e){if(0n===t)return m;if(t<1000n){const i=Number(t);return"feminine"===e?function(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10)%10,n=Math.trunc(t/100),r=[];return n>0&&(r.push(u[n]),r.push(1===n?g:d)),i>1&&r.push(f[i]),1===i?r.push(c[e]):e>0&&r.push(l[e]),r.join(" ")}(i):B(i)}return function(t){const e=t.toString(),i=e.length,n=[],r=i%3;let s=0;for(r>0&&(n.push(Number(e.slice(0,r))),s=r);s<i;)n.push(Number(e.slice(s,s+3))),s+=3;const o=[];let a=n.length-1;for(let t=0;t<n.length;t++){const e=n[t];if(0!==e){const t=B(e);if(0===a)o.push(t);else{const i=R(e,N[a-1]);o.push(t+" "+i)}}a--}return o.join(" ")}(t)}const x={gender:"masculine"},T={gender:["masculine","feminine"]};function P(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10);return 0===i?h[e]:1===i?b[e]:0===e?v[i]:f[i]+" "+h[e]}function S(t){if(t<100n)return P(Number(t));if(t<1000n){const e=Number(t),i=Math.trunc(e/100),n=e%100;return 0===n?y[i]:u[i]+" "+(1===i?g:d)+" "+P(n)}if(t<1000000n){const e=Number(t/1000n),i=Number(t%1000n);if(0===i){if(1===e)return w[0];const t=R(e,N[0]);return B(e)+" "+t+" "+w[0]}const n=R(e,N[0]);return B(e)+" "+n+" "+S(BigInt(i))}return function(t){const e=t.toString(),i=e.length,n=[],r=i%3;let s=0;for(r>0&&(n.push(Number(e.slice(0,r))),s=r);s<i;)n.push(Number(e.slice(s,s+3))),s+=3;let o=n.length-1;for(;o>=0&&0===n[o];)o--;const a=[];let u=n.length-1;for(let t=0;t<n.length;t++){const e=n[t];if(0!==e){const i=t===o;if(0===u)a.push(i?S(BigInt(e)):B(e));else if(i)if(1===e)a.push(w[u-1]);else{const t=R(e,N[u-1]);a.push(B(e)+" "+t+" "+w[u-1])}else{const t=R(e,N[u-1]);a.push(B(e)+" "+t)}}u--}return a.join(" ")}(t)}const M={ltLT:function(t){const i=function(t){const i=typeof t;if("bigint"==typeof t){if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(t))throw new RangeError("Ordinals must be whole numbers");if(t<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(t)}if("string"==typeof t)return function(t){const i=t.trim();if(0===i.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===i[0])throw new RangeError("Ordinals cannot be negative");if(i.includes("."))throw new RangeError("Ordinals must be whole numbers");if(n(i)){const t=e(i);if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");const n=BigInt(t);if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}try{const t=BigInt(i);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${t}"`,{cause:e})}}(t);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${i}`)}(t);return o(i,E),S(i)}};t.currency={ltLT:function(t){const{isNegative:e,dollars:n,cents:r}=function(t){const e=typeof t;if("bigint"==typeof t)return t<0n?{isNegative:!0,dollars:-t,cents:0n}:{isNegative:!1,dollars:t,cents:0n};if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(t)?t<0?{isNegative:!0,dollars:BigInt(-t),cents:0n}:{isNegative:!1,dollars:BigInt(t),cents:0n}:s(i(t))}if("string"==typeof t)return s(t);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${e}`)}(t);o(n,O);let a="";return e&&(a=p+" "),(n>0n||0n===r)&&(a+=$(n,"masculine"),a+=" "+R(Number(n),k)),r>0n&&(n>0n&&(a+=" "),a+=$(r,"masculine"),a+=" "+R(Number(r),j)),a}},t.ltLT=function(t,s){const{isNegative:a,integerPart:u,decimalPart:l}=function(t){const s=typeof t;if("bigint"==typeof t)return t<0n?{isNegative:!0,integerPart:-t}:{isNegative:!1,integerPart:t};if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(t)?t<0?{isNegative:!0,integerPart:BigInt(-t)}:{isNegative:!1,integerPart:BigInt(t)}:r(i(t))}if("string"==typeof t)return r(function(t){const i=t.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid number format: "${t}"`);return n(i)?e(i):i}(t));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(t);o(u,I,l);const{gender:c}=function(t,e,i){const n={...e};if(void 0===t)return n;if(!function(t){if(null===t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}(t))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof t);const r=Object.keys(e);for(const[s,o]of Object.entries(t)){if(!Object.hasOwn(e,s))throw new TypeError(`Unknown option "${s}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof n[s])throw new TypeError(`Option "${s}" must be a ${typeof n[s]}, got ${typeof o}`);if(void 0!==i&&Object.hasOwn(i,s)){const t=i[s];if(!t.includes(o))throw new RangeError(`Option "${s}" must be one of: ${t.join(", ")} — got ${JSON.stringify(o)}`)}n[s]=o}}return n}(s,x,T);let f="";return a&&(f=p+" "),f+=$(u,c),l&&(f+=" kablelis "+function(t,e){let i="",n=0;for(;n<t.length&&"0"===t[n];)i&&(i+=" "),i+=m,n++;const r=t.slice(n);return r&&(i&&(i+=" "),i+=$(BigInt(r),e)),i}(l,c)),f},t.ordinal=M},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).n2words=t.n2words||{});
|
package/dist/lv-LV.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/lv-LV v5.1.
|
|
1
|
+
/*! n2words/lv-LV v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function t(t){let[e,i]=t.toLowerCase().split("e");const n=parseInt(i,10);let r="";"-"===e[0]&&(r="-",e=e.slice(1));const s=e.indexOf("."),o=-1===s?e:e.slice(0,s)+e.slice(s+1),a=(-1===s?e.length:s)+n;return a>=o.length?r+o+"0".repeat(a-o.length):a<=0?r+"0."+"0".repeat(-a)+o:r+o.slice(0,a)+"."+o.slice(a)}function e(e){const n=e.toString();return i(n)?t(n):n}function i(t){return t.includes("e")||t.includes("E")}function n(t){const e="-"===t[0];e&&(t=t.slice(1));const i=t.indexOf(".");if(-1===i)return{isNegative:e,integerPart:BigInt(t)};const n=t.slice(0,i)||"0",r=t.slice(i+1);return{isNegative:e,integerPart:BigInt(n),decimalPart:r}}function r(e){let n=e.trim();if(0===n.length||Number.isNaN(Number(n)))throw new RangeError(`Invalid currency format: "${e}"`);i(n)&&(n=t(n));const r="-"===n[0];r&&(n=n.slice(1));const s=n.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(n),cents:0n};const o=n.slice(0,s)||"0",a=(n.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(a)}}function s(t,e,i){if(null===e)return;if(t<e&&!(i&&BigInt(i)>=e))return;const n=e.toString().length-1,r=e===10n**BigInt(n)?`10^${n} - 1`:""+(e-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function o(t){return 10n**BigInt(3*(t+1))}const a=["","viens","divi","trīs","četri","pieci","seši","septiņi","astoņi","deviņi"],u=["","viena","divas","trīs","četras","piecas","sešas","septiņas","astoņas","deviņas"],c=["desmit","vienpadsmit","divpadsmit","trīspadsmit","četrpadsmit","piecpadsmit","sešpadsmit","septiņpadsmit","astoņpadsmit","deviņpadsmit"],l=["","","divdesmit","trīsdesmit","četrdesmit","piecdesmit","sešdesmit","septiņdesmit","astoņdesmit","deviņdesmit"],f="simts",m="simti",p="simtu",d="nulle",g="mīnus",h=["","pirmais","otrais","trešais","ceturtais","piektais","sestais","septītais","astotais","devītais"],b=["desmitais","vienpadsmitais","divpadsmitais","trīspadsmitais","četrpadsmitais","piecpadsmitais","sešpadsmitais","septiņpadsmitais","astoņpadsmitais","deviņpadsmitais"],v=["","","divdesmitais","trīsdesmitais","četrdesmitais","piecdesmitais","sešdesmitais","septiņdesmitais","astoņdesmitais","deviņdesmitais"],w=["","simtais","divsimtais","trīssimtais","četrsimtais","piecsimtais","sešsimtais","septiņsimtais","astoņsimtais","deviņsimtais"],N=["tūkstošais","miljonais","miljardais","triljonais"],j=["cents","centi","centu"],y=[["tūkstotis","tūkstoši","tūkstošu"],["miljons","miljoni","miljonu"],["miljards","miljardi","miljardu"],["triljons","triljoni","triljonu"],["kvadriljons","kvadriljoni","kvadriljonu"],["kvintiljons","kvintiljoni","kvintiljonu"],["sikstiljons","sikstiljoni","sikstiljonu"],["septiljons","septiljoni","septiljonu"],["oktiljons","oktiljoni","oktiljonu"]],I=o(y.length),E=o(N.length),O=o(y.length);function k(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10)%10,n=Math.trunc(t/100),r=[];return n>0&&(1===n&&0===i&&e>0?r.push(p):n>1?(r.push(a[n]),r.push(m)):r.push(f)),i>1&&r.push(l[i]),1===i?r.push(c[e]):e>0&&r.push(a[e]),r.join(" ")}function B(t,e){return 0===t?e[2]:1==t%10&&11!=t%100?e[0]:e[1]}function R(t,e){if(0n===t)return d;if(t<1000n){const i=Number(t);return"feminine"===e?function(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10)%10,n=Math.trunc(t/100),r=[];return n>0&&(1===n&&0===i&&e>0?r.push(p):n>1?(r.push(a[n]),r.push(m)):r.push(f)),i>1&&r.push(l[i]),1===i?r.push(c[e]):e>0&&r.push(u[e]),r.join(" ")}(i):k(i)}return function(t){const e=t.toString(),i=e.length,n=[],r=i%3;let s=0;for(r>0&&(n.push(Number(e.slice(0,r))),s=r);s<i;)n.push(Number(e.slice(s,s+3))),s+=3;const o=[];let a=n.length-1;for(let t=0;t<n.length;t++){const e=n[t];if(0!==e){const t=k(e);if(0===a)o.push(t);else{const i=B(e,y[a-1]);o.push(1===e?i:t+" "+i)}}a--}return o.join(" ")}(t)}const $={gender:"masculine"},P={gender:["masculine","feminine"]};function x(r,o){const{isNegative:a,integerPart:u,decimalPart:c}=function(r){const s=typeof r;if("bigint"==typeof r)return r<0n?{isNegative:!0,integerPart:-r}:{isNegative:!1,integerPart:r};if("number"==typeof r){if(!Number.isFinite(r))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(r)?r<0?{isNegative:!0,integerPart:BigInt(-r)}:{isNegative:!1,integerPart:BigInt(r)}:n(e(r))}if("string"==typeof r)return n(function(e){const n=e.trim();if(0===n.length||Number.isNaN(Number(n)))throw new RangeError(`Invalid number format: "${e}"`);return i(n)?t(n):n}(r));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(r);s(u,I,c);const{gender:l}=function(t,e,i){const n={...e};if(void 0===t)return n;if(!function(t){if(null===t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}(t))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof t);const r=Object.keys(e);for(const[s,o]of Object.entries(t)){if(!Object.hasOwn(e,s))throw new TypeError(`Unknown option "${s}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof n[s])throw new TypeError(`Option "${s}" must be a ${typeof n[s]}, got ${typeof o}`);if(void 0!==i&&Object.hasOwn(i,s)){const t=i[s];if(!t.includes(o))throw new RangeError(`Option "${s}" must be one of: ${t.join(", ")} — got ${JSON.stringify(o)}`)}n[s]=o}}return n}(o,$,P);let f="";return a&&(f=g+" "),f+=R(u,l),c&&(f+=" komats "+function(t,e){let i="",n=0;for(;n<t.length&&"0"===t[n];)i&&(i+=" "),i+=d,n++;const r=t.slice(n);return r&&(i&&(i+=" "),i+=R(BigInt(r),e)),i}(c,l)),f}function S(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10);return 0===i?h[e]:1===i?b[e]:0===e?v[i]:l[i]+" "+h[e]}function M(t){if(t<100n)return S(Number(t));if(t<1000n){const e=Number(t),i=Math.trunc(e/100),n=e%100;if(0===n)return w[i];let r;return r=1===i?f:a[i]+" "+m,r+" "+S(n)}if(t<1000000n){const e=Number(t/1000n),i=Number(t%1000n);if(0===i){if(1===e)return N[0];const t=B(e,y[0]);return k(e)+" "+t+" "+N[0]}const n=B(e,y[0]),r=1===e?"":k(e)+" ";return(1===e?n:r+n)+" "+M(BigInt(i))}return function(t){const e=t.toString(),i=e.length,n=[],r=i%3;let s=0;for(r>0&&(n.push(Number(e.slice(0,r))),s=r);s<i;)n.push(Number(e.slice(s,s+3))),s+=3;let o=n.length-1;for(;o>=0&&0===n[o];)o--;const a=[];let u=n.length-1;for(let t=0;t<n.length;t++){const e=n[t];if(0!==e){const i=t===o;if(0===u)a.push(i?M(BigInt(e)):k(e));else if(i)if(1===e)a.push(N[u-1]);else{const t=B(e,y[u-1]);a.push(k(e)+" "+t+" "+N[u-1])}else{const t=B(e,y[u-1]);a.push(1===e?t:k(e)+" "+t)}}u--}return a.join(" ")}(t)}function T(e){const n=function(e){const n=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const n=e.trim();if(0===n.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===n[0])throw new RangeError("Ordinals cannot be negative");if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");if(i(n)){const e=t(n);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const i=BigInt(e);if(i<=0n)throw new RangeError("Ordinals must be positive integers");return i}try{const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}catch(t){if(t instanceof RangeError)throw t;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:t})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);return s(n,E),M(n)}function F(t){const{isNegative:i,dollars:n,cents:o}=function(t){const i=typeof t;if("bigint"==typeof t)return t<0n?{isNegative:!0,dollars:-t,cents:0n}:{isNegative:!1,dollars:t,cents:0n};if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(t)?t<0?{isNegative:!0,dollars:BigInt(-t),cents:0n}:{isNegative:!1,dollars:BigInt(t),cents:0n}:r(e(t))}if("string"==typeof t)return r(t);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${i}`)}(t);s(n,O);let a="";return i&&(a=g+" "),(n>0n||0n===o)&&(a+=R(n,"masculine"),a+=" eiro"),o>0n&&(n>0n&&(a+=" "),a+=R(o,"masculine"),a+=" "+function(t){if(0===t)return j[2];const e=t%10,i=t%100;return i>=10&&i<=19||0===e?j[2]:1===e?j[0]:j[1]}(Number(o))),a}export{$ as cardinalDefaults,I as cardinalMax,P as cardinalValues,O as currencyMax,E as ordinalMax,x as toCardinal,F as toCurrency,T as toOrdinal};
|
package/dist/lv-LV.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/lv-LV v5.1.
|
|
1
|
+
/*! n2words/lv-LV v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var t,e;t=this,e=function(t){"use strict";function e(t){let[e,i]=t.toLowerCase().split("e");const n=parseInt(i,10);let r="";"-"===e[0]&&(r="-",e=e.slice(1));const s=e.indexOf("."),o=-1===s?e:e.slice(0,s)+e.slice(s+1),u=(-1===s?e.length:s)+n;return u>=o.length?r+o+"0".repeat(u-o.length):u<=0?r+"0."+"0".repeat(-u)+o:r+o.slice(0,u)+"."+o.slice(u)}function i(t){const i=t.toString();return n(i)?e(i):i}function n(t){return t.includes("e")||t.includes("E")}function r(t){const e="-"===t[0];e&&(t=t.slice(1));const i=t.indexOf(".");if(-1===i)return{isNegative:e,integerPart:BigInt(t)};const n=t.slice(0,i)||"0",r=t.slice(i+1);return{isNegative:e,integerPart:BigInt(n),decimalPart:r}}function s(t){let i=t.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid currency format: "${t}"`);n(i)&&(i=e(i));const r="-"===i[0];r&&(i=i.slice(1));const s=i.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(i),cents:0n};const o=i.slice(0,s)||"0",u=(i.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(u)}}function o(t,e,i){if(null===e)return;if(t<e&&!(i&&BigInt(i)>=e))return;const n=e.toString().length-1,r=e===10n**BigInt(n)?`10^${n} - 1`:""+(e-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function u(t){return 10n**BigInt(3*(t+1))}const a=["","viens","divi","trīs","četri","pieci","seši","septiņi","astoņi","deviņi"],c=["","viena","divas","trīs","četras","piecas","sešas","septiņas","astoņas","deviņas"],l=["desmit","vienpadsmit","divpadsmit","trīspadsmit","četrpadsmit","piecpadsmit","sešpadsmit","septiņpadsmit","astoņpadsmit","deviņpadsmit"],f=["","","divdesmit","trīsdesmit","četrdesmit","piecdesmit","sešdesmit","septiņdesmit","astoņdesmit","deviņdesmit"],d="simts",m="simti",p="simtu",g="nulle",h="mīnus",v=["","pirmais","otrais","trešais","ceturtais","piektais","sestais","septītais","astotais","devītais"],b=["desmitais","vienpadsmitais","divpadsmitais","trīspadsmitais","četrpadsmitais","piecpadsmitais","sešpadsmitais","septiņpadsmitais","astoņpadsmitais","deviņpadsmitais"],w=["","","divdesmitais","trīsdesmitais","četrdesmitais","piecdesmitais","sešdesmitais","septiņdesmitais","astoņdesmitais","deviņdesmitais"],N=["","simtais","divsimtais","trīssimtais","četrsimtais","piecsimtais","sešsimtais","septiņsimtais","astoņsimtais","deviņsimtais"],j=["tūkstošais","miljonais","miljardais","triljonais"],y=["cents","centi","centu"],I=[["tūkstotis","tūkstoši","tūkstošu"],["miljons","miljoni","miljonu"],["miljards","miljardi","miljardu"],["triljons","triljoni","triljonu"],["kvadriljons","kvadriljoni","kvadriljonu"],["kvintiljons","kvintiljoni","kvintiljonu"],["sikstiljons","sikstiljoni","sikstiljonu"],["septiljons","septiljoni","septiljonu"],["oktiljons","oktiljoni","oktiljonu"]],E=u(I.length),O=u(j.length),k=u(I.length);function B(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10)%10,n=Math.trunc(t/100),r=[];return n>0&&(1===n&&0===i&&e>0?r.push(p):n>1?(r.push(a[n]),r.push(m)):r.push(d)),i>1&&r.push(f[i]),1===i?r.push(l[e]):e>0&&r.push(a[e]),r.join(" ")}function R(t,e){return 0===t?e[2]:1==t%10&&11!=t%100?e[0]:e[1]}function $(t,e){if(0n===t)return g;if(t<1000n){const i=Number(t);return"feminine"===e?function(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10)%10,n=Math.trunc(t/100),r=[];return n>0&&(1===n&&0===i&&e>0?r.push(p):n>1?(r.push(a[n]),r.push(m)):r.push(d)),i>1&&r.push(f[i]),1===i?r.push(l[e]):e>0&&r.push(c[e]),r.join(" ")}(i):B(i)}return function(t){const e=t.toString(),i=e.length,n=[],r=i%3;let s=0;for(r>0&&(n.push(Number(e.slice(0,r))),s=r);s<i;)n.push(Number(e.slice(s,s+3))),s+=3;const o=[];let u=n.length-1;for(let t=0;t<n.length;t++){const e=n[t];if(0!==e){const t=B(e);if(0===u)o.push(t);else{const i=R(e,I[u-1]);o.push(1===e?i:t+" "+i)}}u--}return o.join(" ")}(t)}const x={gender:"masculine"},P={gender:["masculine","feminine"]};function T(t){if(0===t)return"";const e=t%10,i=Math.trunc(t/10);return 0===i?v[e]:1===i?b[e]:0===e?w[i]:f[i]+" "+v[e]}function S(t){if(t<100n)return T(Number(t));if(t<1000n){const e=Number(t),i=Math.trunc(e/100),n=e%100;if(0===n)return N[i];let r;return r=1===i?d:a[i]+" "+m,r+" "+T(n)}if(t<1000000n){const e=Number(t/1000n),i=Number(t%1000n);if(0===i){if(1===e)return j[0];const t=R(e,I[0]);return B(e)+" "+t+" "+j[0]}const n=R(e,I[0]),r=1===e?"":B(e)+" ";return(1===e?n:r+n)+" "+S(BigInt(i))}return function(t){const e=t.toString(),i=e.length,n=[],r=i%3;let s=0;for(r>0&&(n.push(Number(e.slice(0,r))),s=r);s<i;)n.push(Number(e.slice(s,s+3))),s+=3;let o=n.length-1;for(;o>=0&&0===n[o];)o--;const u=[];let a=n.length-1;for(let t=0;t<n.length;t++){const e=n[t];if(0!==e){const i=t===o;if(0===a)u.push(i?S(BigInt(e)):B(e));else if(i)if(1===e)u.push(j[a-1]);else{const t=R(e,I[a-1]);u.push(B(e)+" "+t+" "+j[a-1])}else{const t=R(e,I[a-1]);u.push(1===e?t:B(e)+" "+t)}}a--}return u.join(" ")}(t)}const M={lvLV:function(t){const i=function(t){const i=typeof t;if("bigint"==typeof t){if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(t))throw new RangeError("Ordinals must be whole numbers");if(t<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(t)}if("string"==typeof t)return function(t){const i=t.trim();if(0===i.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===i[0])throw new RangeError("Ordinals cannot be negative");if(i.includes("."))throw new RangeError("Ordinals must be whole numbers");if(n(i)){const t=e(i);if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");const n=BigInt(t);if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}try{const t=BigInt(i);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${t}"`,{cause:e})}}(t);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${i}`)}(t);return o(i,O),S(i)}};t.currency={lvLV:function(t){const{isNegative:e,dollars:n,cents:r}=function(t){const e=typeof t;if("bigint"==typeof t)return t<0n?{isNegative:!0,dollars:-t,cents:0n}:{isNegative:!1,dollars:t,cents:0n};if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(t)?t<0?{isNegative:!0,dollars:BigInt(-t),cents:0n}:{isNegative:!1,dollars:BigInt(t),cents:0n}:s(i(t))}if("string"==typeof t)return s(t);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${e}`)}(t);o(n,k);let u="";return e&&(u=h+" "),(n>0n||0n===r)&&(u+=$(n,"masculine"),u+=" eiro"),r>0n&&(n>0n&&(u+=" "),u+=$(r,"masculine"),u+=" "+function(t,e){if(0===t)return e[2];const i=t%10,n=t%100;return n>=10&&n<=19||0===i?e[2]:1===i?e[0]:e[1]}(Number(r),y)),u}},t.lvLV=function(t,s){const{isNegative:u,integerPart:a,decimalPart:c}=function(t){const s=typeof t;if("bigint"==typeof t)return t<0n?{isNegative:!0,integerPart:-t}:{isNegative:!1,integerPart:t};if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(t)?t<0?{isNegative:!0,integerPart:BigInt(-t)}:{isNegative:!1,integerPart:BigInt(t)}:r(i(t))}if("string"==typeof t)return r(function(t){const i=t.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid number format: "${t}"`);return n(i)?e(i):i}(t));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(t);o(a,E,c);const{gender:l}=function(t,e,i){const n={...e};if(void 0===t)return n;if(!function(t){if(null===t||"object"!=typeof t)return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}(t))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof t);const r=Object.keys(e);for(const[s,o]of Object.entries(t)){if(!Object.hasOwn(e,s))throw new TypeError(`Unknown option "${s}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof n[s])throw new TypeError(`Option "${s}" must be a ${typeof n[s]}, got ${typeof o}`);if(void 0!==i&&Object.hasOwn(i,s)){const t=i[s];if(!t.includes(o))throw new RangeError(`Option "${s}" must be one of: ${t.join(", ")} — got ${JSON.stringify(o)}`)}n[s]=o}}return n}(s,x,P);let f="";return u&&(f=h+" "),f+=$(a,l),c&&(f+=" komats "+function(t,e){let i="",n=0;for(;n<t.length&&"0"===t[n];)i&&(i+=" "),i+=g,n++;const r=t.slice(n);return r&&(i&&(i+=" "),i+=$(BigInt(r),e)),i}(c,l)),f},t.ordinal=M},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).n2words=t.n2words||{});
|
package/dist/mr-IN.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/mr-IN v5.1.
|
|
1
|
+
/*! n2words/mr-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3+2*(e-1))}const u="शून्य",a="शंभर",c=["","पहिला","दुसरा","तिसरा","चौथा","पाचवा","सहावा"],g=["शून्य","एक","दोन","तीन","चार","पाच","सहा","सात","आठ","नऊ","दहा","अकरा","बारा","तेरा","चौदा","पंधरा","सोळा","सतरा","अठरा","एकोणीस","वीस","एकवीस","बावीस","तेवीस","चोवीस","पंचवीस","सव्वीस","सत्तावीस","अठ्ठावीस","एकोणतीस","तीस","एकतीस","बत्तीस","तेहेतीस","चौतीस","पस्तीस","छत्तीस","सदतीस","अडतीस","एकोणचाळीस","चाळीस","एकेचाळीस","बेचाळीस","त्रेचाळीस","चव्वेचाळीस","पंचेचाळीस","सेहेचाळीस","सत्तेचाळीस","अठ्ठेचाळीस","एकोणपन्नास","पन्नास","एक्काव्वन","बावन्न","त्रेपन्न","चोपन्न","पंचाव्वन","छप्पन्न","सत्तावन्न","अठ्ठावन्न","एकोणसाठ","साठ","एकसष्ठ","बासष्ठ","त्रेसष्ठ","चौसष्ठ","पासष्ठ","सहासष्ठ","सदुसष्ठ","अडुसष्ठ","एकोणसत्तर","सत्तर","एकाहत्तर","बाहत्तर","त्र्याहत्तर","चौऱ्याहत्तर","पंच्याहत्तर","शहात्तर","सत्याहत्तर","अठ्ठ्याहत्तर","एकोणऐंशी","ऐंशी","एक्याऐंशी","ब्याऐंशी","त्र्याऐंशी","चौऱ्याऐंशी","पंच्याऐंशी","शहाऐंशी","सत्याऐंशी","अठ्ठ्याऐंशी","एकोणनव्वद","नव्वद","एक्याण्णव","ब्याण्णव","त्र्याण्णव","चौऱ्याण्णव","पंच्याण्णव","शहाण्णव","सत्याण्णव","अठ्ठ्याण्णव","नव्याण्णव"],f=["","हजार","लाख","कोटी","अब्ज","खर्व","निखर्व","महापद्म","शंकू"],l=s(f.length),m=s(f.length),b=s(f.length);function w(e){if(0===e)return"";if(e<100)return g[e];const n=Math.trunc(e/100),t=e%100;return 0===t?g[n]+" "+a:g[n]+" "+a+" "+g[t]}function d(e){if(0n===e)return u;if(e<1000n)return w(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?w(t):g[t]),e>0&&f[e]&&r.push(f[e]))}return r.join(" ")}function h(i){const{isNegative:s,integerPart:a,decimalPart:c}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(a,l);let f="";return s&&(f="उणे "),f+=d(a),c&&(f+=" दशांश "+function(e){const n=[];for(const t of e){const e=parseInt(t,10);n.push(0===e?u:g[e])}return n.join(" ")}(c)),f}function p(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,m),(i=r)>=1n&&i<=6n?c[Number(i)]:d(i)+"वा";var i}function N(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,b);let u="";return t&&(u="उणे "),(r>0n||0n===s)&&(u+=d(r),u+=" "+(1n===r?"रुपया":"रुपये")),s>0n&&(r>0n&&(u+=" "),u+=d(s),u+=" "+(1n===s?"पैसा":"पैसे")),u}export{l as cardinalMax,b as currencyMax,m as ordinalMax,h as toCardinal,N as toCurrency,p as toOrdinal};
|
package/dist/mr-IN.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/mr-IN v5.1.
|
|
1
|
+
/*! n2words/mr-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3+2*(e-1))}const a="शून्य",c="शंभर",f=["","पहिला","दुसरा","तिसरा","चौथा","पाचवा","सहावा"],g=["शून्य","एक","दोन","तीन","चार","पाच","सहा","सात","आठ","नऊ","दहा","अकरा","बारा","तेरा","चौदा","पंधरा","सोळा","सतरा","अठरा","एकोणीस","वीस","एकवीस","बावीस","तेवीस","चोवीस","पंचवीस","सव्वीस","सत्तावीस","अठ्ठावीस","एकोणतीस","तीस","एकतीस","बत्तीस","तेहेतीस","चौतीस","पस्तीस","छत्तीस","सदतीस","अडतीस","एकोणचाळीस","चाळीस","एकेचाळीस","बेचाळीस","त्रेचाळीस","चव्वेचाळीस","पंचेचाळीस","सेहेचाळीस","सत्तेचाळीस","अठ्ठेचाळीस","एकोणपन्नास","पन्नास","एक्काव्वन","बावन्न","त्रेपन्न","चोपन्न","पंचाव्वन","छप्पन्न","सत्तावन्न","अठ्ठावन्न","एकोणसाठ","साठ","एकसष्ठ","बासष्ठ","त्रेसष्ठ","चौसष्ठ","पासष्ठ","सहासष्ठ","सदुसष्ठ","अडुसष्ठ","एकोणसत्तर","सत्तर","एकाहत्तर","बाहत्तर","त्र्याहत्तर","चौऱ्याहत्तर","पंच्याहत्तर","शहात्तर","सत्याहत्तर","अठ्ठ्याहत्तर","एकोणऐंशी","ऐंशी","एक्याऐंशी","ब्याऐंशी","त्र्याऐंशी","चौऱ्याऐंशी","पंच्याऐंशी","शहाऐंशी","सत्याऐंशी","अठ्ठ्याऐंशी","एकोणनव्वद","नव्वद","एक्याण्णव","ब्याण्णव","त्र्याण्णव","चौऱ्याण्णव","पंच्याण्णव","शहाण्णव","सत्याण्णव","अठ्ठ्याण्णव","नव्याण्णव"],l=["","हजार","लाख","कोटी","अब्ज","खर्व","निखर्व","महापद्म","शंकू"],d=u(l.length),m=u(l.length),b=u(l.length);function p(e){if(0===e)return"";if(e<100)return g[e];const n=Math.trunc(e/100),t=e%100;return 0===t?g[n]+" "+c:g[n]+" "+c+" "+g[t]}function h(e){if(0n===e)return a;if(e<1000n)return p(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?p(t):g[t]),e>0&&l[e]&&r.push(l[e]))}return r.join(" ")}const w={mrIN:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,m),(i=t)>=1n&&i<=6n?f[Number(i)]:h(i)+"वा";var i}};e.currency={mrIN:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,b);let u="";return n&&(u="उणे "),(r>0n||0n===i)&&(u+=h(r),u+=" "+(1n===r?"रुपया":"रुपये")),i>0n&&(r>0n&&(u+=" "),u+=h(i),u+=" "+(1n===i?"पैसा":"पैसे")),u}},e.mrIN=function(e){const{isNegative:o,integerPart:u,decimalPart:c}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,d);let f="";return o&&(f="उणे "),f+=h(u),c&&(f+=" दशांश "+function(e){const n=[];for(const t of e){const e=parseInt(t,10);n.push(0===e?a:g[e])}return n.join(" ")}(c)),f},e.ordinal=w},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
|
package/dist/ms-MY.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/ms-MY v5.1.
|
|
1
|
+
/*! n2words/ms-MY v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const s=n.indexOf("."),u=-1===s?n:n.slice(0,s)+n.slice(s+1),o=(-1===s?n.length:s)+r;return o>=u.length?i+u+"0".repeat(o-u.length):o<=0?i+"0."+"0".repeat(-o)+u:i+u.slice(0,o)+"."+u.slice(o)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const s=r.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(r),cents:0n};const u=r.slice(0,s)||"0",o=(r.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(u),cents:BigInt(o)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}const o=["","satu","dua","tiga","empat","lima","enam","tujuh","lapan","sembilan"],a=["sepuluh","sebelas","dua belas","tiga belas","empat belas","lima belas","enam belas","tujuh belas","lapan belas","sembilan belas"],l=["","","dua puluh","tiga puluh","empat puluh","lima puluh","enam puluh","tujuh puluh","lapan puluh","sembilan puluh"],g="ratus",c="ribu",f=["juta","bilion","trilion"],m=u(f.length+1),b=u(f.length+1),h=u(f.length+1),p="sifar",d="minus";function w(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100),i=[];r>0&&i.push(1===r?"se"+g:o[r]+" "+g);const s=e%100;return 0===s||i.push(s<10?o[s]:s<20?a[s-10]:0===n?l[t]:l[t]+" "+o[n]),i.join(" ")}function N(e){if(0n===e)return p;if(e<1000n)return w(Number(e));if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r;return r=1===n?"se"+c:w(n)+" "+c,t>0&&(r+=" "+w(t)),r}return function(e){const n=e.toString(),t=n.length,r=[],i=t%3;let s=0;for(i>0&&(r.push(Number(n.slice(0,i))),s=i);s<t;)r.push(Number(n.slice(s,s+3))),s+=3;const u=[];let o=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===o)u.push(w(n));else if(1===o)u.push(1===n?"se"+c:w(n)+" "+c);else{const e=f[o-2];u.push(1===n?"se"+e:w(n)+" "+e)}o--}return u.join(" ")}(e)}function v(i){const{isNegative:u,integerPart:o,decimalPart:a}=function(i){const s=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(i);s(o,m,a);let l="";return u&&(l=d+" "),l+=N(o),a&&(l+=" perpuluhan "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=p,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=N(BigInt(r))),n}(a)),l}function I(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return s(r,b),1n===(i=r)?"pertama":"ke"+N(i);var i}function y(e){const{isNegative:t,dollars:r,cents:u}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);s(r,h);let o="";return t&&(o=d+" "),(r>0n||0n===u)&&(o+=N(r),o+=" ringgit"),u>0n&&(r>0n&&(o+=" "),o+=N(u),o+=" sen"),o}export{m as cardinalMax,h as currencyMax,b as ordinalMax,v as toCardinal,y as toCurrency,I as toOrdinal};
|
package/dist/ms-MY.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/ms-MY v5.1.
|
|
1
|
+
/*! n2words/ms-MY v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const s=n.indexOf("."),o=-1===s?n:n.slice(0,s)+n.slice(s+1),u=(-1===s?n.length:s)+r;return u>=o.length?i+o+"0".repeat(u-o.length):u<=0?i+"0."+"0".repeat(-u)+o:i+o.slice(0,u)+"."+o.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function s(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const s=t.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(t),cents:0n};const o=t.slice(0,s)||"0",u=(t.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(o),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}const a=["","satu","dua","tiga","empat","lima","enam","tujuh","lapan","sembilan"],l=["sepuluh","sebelas","dua belas","tiga belas","empat belas","lima belas","enam belas","tujuh belas","lapan belas","sembilan belas"],c=["","","dua puluh","tiga puluh","empat puluh","lima puluh","enam puluh","tujuh puluh","lapan puluh","sembilan puluh"],g="ratus",f="ribu",m=["juta","bilion","trilion"],p=u(m.length+1),b=u(m.length+1),h=u(m.length+1),d="sifar",w="minus";function N(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100),i=[];r>0&&i.push(1===r?"se"+g:a[r]+" "+g);const s=e%100;return 0===s||i.push(s<10?a[s]:s<20?l[s-10]:0===n?c[t]:c[t]+" "+a[n]),i.join(" ")}function v(e){if(0n===e)return d;if(e<1000n)return N(Number(e));if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r;return r=1===n?"se"+f:N(n)+" "+f,t>0&&(r+=" "+N(t)),r}return function(e){const n=e.toString(),t=n.length,r=[],i=t%3;let s=0;for(i>0&&(r.push(Number(n.slice(0,i))),s=i);s<t;)r.push(Number(n.slice(s,s+3))),s+=3;const o=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===u)o.push(N(n));else if(1===u)o.push(1===n?"se"+f:N(n)+" "+f);else{const e=m[u-2];o.push(1===n?"se"+e:N(n)+" "+e)}u--}return o.join(" ")}(e)}const y={msMY:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return o(t,b),1n===(i=t)?"pertama":"ke"+v(i);var i}};e.currency={msMY:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:s(t(e))}if("string"==typeof e)return s(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);o(r,h);let u="";return n&&(u=w+" "),(r>0n||0n===i)&&(u+=v(r),u+=" ringgit"),i>0n&&(r>0n&&(u+=" "),u+=v(i),u+=" sen"),u}},e.msMY=function(e){const{isNegative:s,integerPart:u,decimalPart:a}=function(e){const s=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(e);o(u,p,a);let l="";return s&&(l=w+" "),l+=v(u),a&&(l+=" perpuluhan "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=d,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=v(BigInt(r))),n}(a)),l},e.ordinal=y},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
|
package/dist/nb-NO.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/nb-NO v5.1.
|
|
1
|
+
/*! n2words/nb-NO v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3*(e+1))}const u=["","en","to","tre","fire","fem","seks","syv","åtte","ni"],l=["ti","elleve","tolv","tretten","fjorten","femten","seksten","sytten","atten","nitten"],a=["","","tjue","tretti","førti","femti","seksti","sytti","åtti","nitti"],g="tusen",c="null",f="minus",d=["million","milliard","billion","billiard","kvintillion","sekstillion","septillion","oktillion"],h=s(d.length+1),m=s(d.length+1),w=s(d.length+1),b={1:"første",2:"andre",3:"tredje",4:"fjerde",5:"femte",6:"sjette",7:"sjuende",8:"åttende",9:"niende",10:"tiende",11:"ellevte",12:"tolvte"};function p(e){if(0===e)return{word:"",hasHundred:!1};const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100),i=[];let o=!1;r>0&&(o=!0,i.push(u[r]+" hundre"));const s=e%100;return 0===s||i.push(s<10?u[n]:s<20?l[n]:0===n?a[t]:a[t]+"-"+u[n]),2===i.length?{word:i[0]+" og "+i[1],hasHundred:!0}:{word:i[0]||"",hasHundred:o}}function v(e){if(0n===e)return c;if(e<1000n)return p(Number(e)).word;if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r=p(n).word+" "+g;if(t>0){const e=p(t);r+=e.hasHundred?", "+e.word:" og "+e.word}return r}return function(e){const n=e.toString(),t=n.length,r=[],i=t%3;let o=0;for(i>0&&(r.push(Number(n.slice(0,i))),o=i);o<t;)r.push(Number(n.slice(o,o+3))),o+=3;const s=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n){const e=p(n);s.push(0===u?{word:e.word,hasHundred:e.hasHundred,type:"units"}:1===u?{word:e.word+" "+g,hasHundred:!1,type:"thousand"}:{word:e.word+" "+d[u-2],hasHundred:!1,type:"million"})}u--}return function(e){if(0===e.length)return c;if(1===e.length)return e[0].word;const n=[];for(let t=0;t<e.length;t++){const r=e[t],i=e[t+1];n.push(r.word),i&&n.push("thousand"===r.type?i.hasHundred?", ":" og ":"million"===r.type?"units"!==i.type||i.hasHundred?" ":" og ":" ")}return n.join("")}(s)}(e)}function N(i){const{isNegative:s,integerPart:u,decimalPart:l}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(u,h,l);let a="";return s&&(a=f+" "),a+=v(u),l&&(a+=" komma "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=c,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=v(BigInt(r))),n}(l)),a}function y(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,m),function(e){if(e>=1n&&e<=12n)return b[Number(e)];const n=Number(e),t=v(e);return n>=13&&n<=19||t.endsWith("en")?t.slice(0,-2)+"ende":t.endsWith("ni")?t+"ede":t+"de"}(r)}function I(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,w);let u="";return t&&(u=f+" "),(r>0n||0n===s)&&(u+=1n===r?"en krone":v(r)+" kroner"),s>0n&&(r>0n&&(u+=" og "),u+=v(s)+" øre"),u}export{h as cardinalMax,w as currencyMax,m as ordinalMax,N as toCardinal,I as toCurrency,y as toOrdinal};
|
package/dist/nb-NO.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/nb-NO v5.1.
|
|
1
|
+
/*! n2words/nb-NO v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}const l=["","en","to","tre","fire","fem","seks","syv","åtte","ni"],a=["ti","elleve","tolv","tretten","fjorten","femten","seksten","sytten","atten","nitten"],c=["","","tjue","tretti","førti","femti","seksti","sytti","åtti","nitti"],f="tusen",d="null",g="minus",h=["million","milliard","billion","billiard","kvintillion","sekstillion","septillion","oktillion"],m=u(h.length+1),w=u(h.length+1),b=u(h.length+1),p={1:"første",2:"andre",3:"tredje",4:"fjerde",5:"femte",6:"sjette",7:"sjuende",8:"åttende",9:"niende",10:"tiende",11:"ellevte",12:"tolvte"};function N(e){if(0===e)return{word:"",hasHundred:!1};const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100),i=[];let o=!1;r>0&&(o=!0,i.push(l[r]+" hundre"));const s=e%100;return 0===s||i.push(s<10?l[n]:s<20?a[n]:0===n?c[t]:c[t]+"-"+l[n]),2===i.length?{word:i[0]+" og "+i[1],hasHundred:!0}:{word:i[0]||"",hasHundred:o}}function v(e){if(0n===e)return d;if(e<1000n)return N(Number(e)).word;if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r=N(n).word+" "+f;if(t>0){const e=N(t);r+=e.hasHundred?", "+e.word:" og "+e.word}return r}return function(e){const n=e.toString(),t=n.length,r=[],i=t%3;let o=0;for(i>0&&(r.push(Number(n.slice(0,i))),o=i);o<t;)r.push(Number(n.slice(o,o+3))),o+=3;const s=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n){const e=N(n);s.push(0===u?{word:e.word,hasHundred:e.hasHundred,type:"units"}:1===u?{word:e.word+" "+f,hasHundred:!1,type:"thousand"}:{word:e.word+" "+h[u-2],hasHundred:!1,type:"million"})}u--}return function(e){if(0===e.length)return d;if(1===e.length)return e[0].word;const n=[];for(let t=0;t<e.length;t++){const r=e[t],i=e[t+1];n.push(r.word),i&&n.push("thousand"===r.type?i.hasHundred?", ":" og ":"million"===r.type?"units"!==i.type||i.hasHundred?" ":" og ":" ")}return n.join("")}(s)}(e)}const y={nbNO:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,w),function(e){if(e>=1n&&e<=12n)return p[Number(e)];const n=Number(e),t=v(e);return n>=13&&n<=19||t.endsWith("en")?t.slice(0,-2)+"ende":t.endsWith("ni")?t+"ede":t+"de"}(t)}};e.currency={nbNO:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,b);let u="";return n&&(u=g+" "),(r>0n||0n===i)&&(u+=1n===r?"en krone":v(r)+" kroner"),i>0n&&(r>0n&&(u+=" og "),u+=v(i)+" øre"),u}},e.nbNO=function(e){const{isNegative:o,integerPart:u,decimalPart:l}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,m,l);let a="";return o&&(a=g+" "),a+=v(u),l&&(a+=" komma "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=d,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=v(BigInt(r))),n}(l)),a},e.ordinal=y},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
|
package/dist/nl-NL.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/nl-NL v5.1.
|
|
1
|
+
/*! n2words/nl-NL v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3*(e+1))}function u(e,n,t){const r={...n};if(void 0===e)return r;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const i=Object.keys(n);for(const[t,o]of Object.entries(e)){if(!Object.hasOwn(n,t))throw new TypeError(`Unknown option "${t}" — expected one of: ${i.join(", ")}`);if(void 0!==o){if(typeof o!=typeof r[t])throw new TypeError(`Option "${t}" must be a ${typeof r[t]}, got ${typeof o}`);r[t]=o}}return r}const c=["","een","twee","drie","vier","vijf","zes","zeven","acht","negen"],l=["tien","elf","twaalf","dertien","veertien","vijftien","zestien","zeventien","achttien","negentien"],a=["","","twintig","dertig","veertig","vijftig","zestig","zeventig","tachtig","negentig"],f="honderd",g=["duizend","miljoen","miljard","biljoen","biljard","triljoen","triljard","quadriljoen","quadriljard"],d=["","duizendste","miljoenste","miljardste","biljoenste","biljardste","triljoenste"],b=s(g.length),m=s(d.length-1),p=s(g.length),h="nul",w="euro";function v(e,n){if(0===e)return"";const t=e%10,r=Math.trunc(e/10)%10,i=Math.trunc(e/100),o=e%100;let s="";if(i>0&&(s=1===i?f:c[i]+f),0===o);else if(o<10)s+=i>0&&n?"en"+c[o]:c[o];else if(o<20)s+=i>0&&n&&o<13?"en"+l[t]:l[t];else if(0===t)s+=a[r];else{const e=c[t],n=e.endsWith("e")?"ën":"en";s+=e+n+a[r]}return s}function N(e,n){if(0n===e)return h;const{accentOne:t,includeOptionalAnd:r,noHundredPairing:i}=n,o=e=>t?e.replace(/\been\b/g,"één"):e;if(e<1000n)return o(v(Number(e),r));if(!i&&e>=1100n&&e<10000n){const n=Number(e/100n),t=Number(e%100n);if(n%10!=0){let e=v(n,r)+f;if(t>0){const n=v(t,r);e+=r&&t<13?" en "+n:" "+n}return o(e)}}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let i;if(i=1===n?g[0]:v(n,r)+g[0],t>0){const e=v(t,r);i+=r&&t<13?" en "+e:" "+e}return o(i)}return o(function(e,n){const{includeOptionalAnd:t}=n,r=[];let i=e;for(;i>0n;)r.push(Number(i%1000n)),i/=1000n;let o="",s=!1;for(let e=r.length-1;e>=0;e--){const n=r[e];if(0!==n)if(0===e){const e=v(n,t);o?o+=s&&t&&n<13?" en "+e:" "+e:o=e,s=!1}else if(1===e)o&&(o+=" "),o+=1===n?g[0]:v(n,t)+g[0],s=!0;else{const r=g[e-1];o&&(o+=" "),o+=1===n?"een "+r:v(n,t)+" "+r,s=!0}}return o}(e,n))}const y={accentOne:!0,includeOptionalAnd:!1,noHundredPairing:!1};function O(i,s){const{isNegative:c,integerPart:l,decimalPart:a}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(l,b,a);const{accentOne:f,includeOptionalAnd:g,noHundredPairing:d}=u(s,y),m={accentOne:f,includeOptionalAnd:g,noHundredPairing:d};let p="";return c&&(p="min "),p+=N(l,m),a&&(p+=" komma "+function(e,n){let t="",r=0;for(;r<e.length&&"0"===e[r];)t&&(t+=" "),t+=h,r++;const i=e.slice(r);return i&&(t&&(t+=" "),t+=N(BigInt(i),{...n,noHundredPairing:!0})),t}(a,m)),p}const I=["","eerste","tweede","derde","vierde","vijfde","zesde","zevende","achtste","negende"];function j(e,n){return n>=1&&n<=9?I[n]:n<20?e.endsWith("d")?e+"e":e+"de":e+"ste"}function E(e){if(0===e)return"";const n=Math.trunc(e/100),t=e%100;if(0===n)return j(v(e,!1),e);let r;return r=1===n?f:c[n]+f,0===t?r+"ste":r+" "+j(v(t,!1),t)}function R(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,m),r<10n?I[Number(r)]:r<100n?j(v(Number(r),!1),Number(r)):r<1000n?E(Number(r)):function(e){const n=[];let t=e;for(;t>0n;)n.push(Number(t%1000n)),t/=1000n;let r=0;for(let e=0;e<n.length;e++)if(0!==n[e]){r=e;break}let i="";for(let e=n.length-1;e>=0;e--){const t=n[e];if(0!==t)if(i&&(i+=" "),e===r)i+=0===e?E(t):1===t&&e>0?1===e?d[e]:"een "+d[e]:1===e?v(t,!1)+d[e]:v(t,!1)+" "+d[e];else if(1===e)i+=1===t?g[0]:v(t,!1)+g[0];else{const n=g[e-1];i+=1===t?"een "+n:v(t,!1)+" "+n}}return i}(r)}const B={and:!0};function P(e,t){const{isNegative:r,dollars:s,cents:c}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(s,p);const{and:l}=u(t,B);let a="";r&&(a="min ");const f=s>0n,g=c>0n;if(!f&&!g)return h+" "+w;const d={accentOne:!0,includeOptionalAnd:!1,noHundredPairing:!0};return f&&(a+=N(s,d)+" "+(1n===s?"euro":w)),g&&(f&&(a+=l?" en ":" "),a+=N(c,d)+" cent"),a}export{y as cardinalDefaults,b as cardinalMax,B as currencyDefaults,p as currencyMax,m as ordinalMax,O as toCardinal,P as toCurrency,R as toOrdinal};
|
package/dist/nl-NL.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/nl-NL v5.1.
|
|
1
|
+
/*! n2words/nl-NL v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}function c(e,n,t){const r={...n};if(void 0===e)return r;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const i=Object.keys(n);for(const[t,o]of Object.entries(e)){if(!Object.hasOwn(n,t))throw new TypeError(`Unknown option "${t}" — expected one of: ${i.join(", ")}`);if(void 0!==o){if(typeof o!=typeof r[t])throw new TypeError(`Option "${t}" must be a ${typeof r[t]}, got ${typeof o}`);r[t]=o}}return r}const l=["","een","twee","drie","vier","vijf","zes","zeven","acht","negen"],a=["tien","elf","twaalf","dertien","veertien","vijftien","zestien","zeventien","achttien","negentien"],f=["","","twintig","dertig","veertig","vijftig","zestig","zeventig","tachtig","negentig"],g="honderd",d=["duizend","miljoen","miljard","biljoen","biljard","triljoen","triljard","quadriljoen","quadriljard"],b=["","duizendste","miljoenste","miljardste","biljoenste","biljardste","triljoenste"],p=u(d.length),m=u(b.length-1),h=u(d.length),w="nul",v="euro";function N(e,n){if(0===e)return"";const t=e%10,r=Math.trunc(e/10)%10,i=Math.trunc(e/100),o=e%100;let s="";if(i>0&&(s=1===i?g:l[i]+g),0===o);else if(o<10)s+=i>0&&n?"en"+l[o]:l[o];else if(o<20)s+=i>0&&n&&o<13?"en"+a[t]:a[t];else if(0===t)s+=f[r];else{const e=l[t],n=e.endsWith("e")?"ën":"en";s+=e+n+f[r]}return s}function y(e,n){if(0n===e)return w;const{accentOne:t,includeOptionalAnd:r,noHundredPairing:i}=n,o=e=>t?e.replace(/\been\b/g,"één"):e;if(e<1000n)return o(N(Number(e),r));if(!i&&e>=1100n&&e<10000n){const n=Number(e/100n),t=Number(e%100n);if(n%10!=0){let e=N(n,r)+g;if(t>0){const n=N(t,r);e+=r&&t<13?" en "+n:" "+n}return o(e)}}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let i;if(i=1===n?d[0]:N(n,r)+d[0],t>0){const e=N(t,r);i+=r&&t<13?" en "+e:" "+e}return o(i)}return o(function(e,n){const{includeOptionalAnd:t}=n,r=[];let i=e;for(;i>0n;)r.push(Number(i%1000n)),i/=1000n;let o="",s=!1;for(let e=r.length-1;e>=0;e--){const n=r[e];if(0!==n)if(0===e){const e=N(n,t);o?o+=s&&t&&n<13?" en "+e:" "+e:o=e,s=!1}else if(1===e)o&&(o+=" "),o+=1===n?d[0]:N(n,t)+d[0],s=!0;else{const r=d[e-1];o&&(o+=" "),o+=1===n?"een "+r:N(n,t)+" "+r,s=!0}}return o}(e,n))}const O={accentOne:!0,includeOptionalAnd:!1,noHundredPairing:!1},I=["","eerste","tweede","derde","vierde","vijfde","zesde","zevende","achtste","negende"];function j(e,n){return n>=1&&n<=9?I[n]:n<20?e.endsWith("d")?e+"e":e+"de":e+"ste"}function E(e){if(0===e)return"";const n=Math.trunc(e/100),t=e%100;if(0===n)return j(N(e,!1),e);let r;return r=1===n?g:l[n]+g,0===t?r+"ste":r+" "+j(N(t,!1),t)}const R={and:!0},B={nlNL:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,m),t<10n?I[Number(t)]:t<100n?j(N(Number(t),!1),Number(t)):t<1000n?E(Number(t)):function(e){const n=[];let t=e;for(;t>0n;)n.push(Number(t%1000n)),t/=1000n;let r=0;for(let e=0;e<n.length;e++)if(0!==n[e]){r=e;break}let i="";for(let e=n.length-1;e>=0;e--){const t=n[e];if(0!==t)if(i&&(i+=" "),e===r)i+=0===e?E(t):1===t&&e>0?1===e?b[e]:"een "+b[e]:1===e?N(t,!1)+b[e]:N(t,!1)+" "+b[e];else if(1===e)i+=1===t?d[0]:N(t,!1)+d[0];else{const n=d[e-1];i+=1===t?"een "+n:N(t,!1)+" "+n}}return i}(t)}};e.currency={nlNL:function(e,n){const{isNegative:r,dollars:i,cents:u}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(i,h);const{and:l}=c(n,R);let a="";r&&(a="min ");const f=i>0n,g=u>0n;if(!f&&!g)return w+" "+v;const d={accentOne:!0,includeOptionalAnd:!1,noHundredPairing:!0};return f&&(a+=y(i,d)+" "+(1n===i?"euro":v)),g&&(f&&(a+=l?" en ":" "),a+=y(u,d)+" cent"),a}},e.nlNL=function(e,o){const{isNegative:u,integerPart:l,decimalPart:a}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(l,p,a);const{accentOne:f,includeOptionalAnd:g,noHundredPairing:d}=c(o,O),b={accentOne:f,includeOptionalAnd:g,noHundredPairing:d};let m="";return u&&(m="min "),m+=y(l,b),a&&(m+=" komma "+function(e,n){let t="",r=0;for(;r<e.length&&"0"===e[r];)t&&(t+=" "),t+=w,r++;const i=e.slice(r);return i&&(t&&(t+=" "),t+=y(BigInt(i),{...n,noHundredPairing:!0})),t}(a,b)),m},e.ordinal=B},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
|
package/dist/pa-IN.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/pa-IN v5.1.
|
|
1
|
+
/*! n2words/pa-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3+2*(e-1))}const u="ਸਿਫ਼ਰ",a="ਮਾਇਨਸ",g=["","ਪਹਿਲਾ","ਦੂਜਾ","ਤੀਜਾ","ਚੌਥਾ","ਪੰਜਵਾਂ","ਛੇਵਾਂ"],c=["ਸਿਫ਼ਰ","ਇੱਕ","ਦੋ","ਤਿੰਨ","ਚਾਰ","ਪੰਜ","ਛੇ","ਸੱਤ","ਅੱਠ","ਨੌਂ","ਦੱਸ","ਗਿਆਰਾਂ","ਬਾਰਾਂ","ਤੇਰਾਂ","ਚੌਦਾਂ","ਪੰਦਰਾਂ","ਸੋਲਾਂ","ਸਤਾਰਾਂ","ਅਠਾਰਾਂ","ਉੱਨੀ","ਵੀਹ","ਇੱਕੀ","ਬਾਈ","ਤੇਈ","ਚੌਬੀ","ਪੱਚੀ","ਛੱਬੀ","ਸਤਾਈ","ਅਠਾਈ","ਉਨੱਤੀ","ਤੀਹ","ਇਕੱਤੀ","ਬੱਤੀ","ਤੇਤੀ","ਚੌਂਤੀ","ਪੈਂਤੀ","ਛੱਤੀ","ਸੈਂਤੀ","ਅਠੱਤੀ","ਉਨਤਾਲੀ","ਚਾਲੀ","ਇਕਤਾਲੀ","ਬਿਆਲੀ","ਤਿਰਤਾਲੀ","ਚੁਵਾਲੀ","ਪੰਤਾਲੀ","ਛਿਆਲੀ","ਸੈਂਤਾਲੀ","ਅਠਤਾਲੀ","ਉਨੰਜਾ","ਪੰਜਾਹ","ਇਕਵੰਜਾ","ਬਵੰਜਾ","ਤਰਵੰਜਾ","ਚੁਰਵੰਜਾ","ਪੰਜਵੰਜਾ","ਛਪੰਜਾ","ਸੱਤਵੰਜਾ","ਅਠਵੰਜਾ","ਉਨਾਹਠ","ਸੱਠ","ਇਕਾਹਠ","ਬਾਹਠ","ਤਰਸਠ","ਚੌਂਸਠ","ਪੈਂਸਠ","ਛਿਆਸਠ","ਸੜਸਠ","ਅੜਸਠ","ਉਣਹੱਤਰ","ਸਤੱਰ","ਇਕਹੱਤਰ","ਬਹੱਤਰ","ਤਹੱਤਰ","ਚੌਹੱਤਰ","ਪੰਝਹੱਤਰ","ਛਿਹੱਤਰ","ਸਤੱਤਰ","ਅਠੱਤਰ","ਉਨਾਸੀ","ਅੱਸੀ","ਇਕਿਆਸੀ","ਬਿਆਸੀ","ਤਰਿਆਸੀ","ਚੌਰਿਆਸੀ","ਪਚਾਸੀ","ਛਿਆਸੀ","ਸੱਤਾਸੀ","ਅਠਾਸੀ","ਨਵਾਸੀ","ਨੱਬੇ","ਇਕਾਨਵੇਂ","ਬਾਨਵੇਂ","ਤਰਾਨਵੇਂ","ਚੁਰਾਨਵੇਂ","ਪੰਚਾਨਵੇਂ","ਛਿਆਨਵੇਂ","ਸਤਾਨਵੇਂ","ਅਠਾਨਵੇਂ","ਨਿਨਾਨਵੇਂ"],l=["","ਹਜ਼ਾਰ","ਲੱਖ","ਕਰੋੜ","ਅਰਬ","ਖਰਬ","ਨੀਲ","ਪਦਮ","ਸ਼ੰਖ"],f=s(l.length),m=s(l.length),b=s(l.length);function w(e){if(0===e)return"";if(e<100)return c[e];const n=Math.trunc(e/100),t=e%100;return 0===t?c[n]+" ਸੌ":c[n]+" ਸੌ "+c[t]}function d(e){if(0n===e)return u;if(e<1000n)return w(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?w(t):c[t]),e>0&&l[e]&&r.push(l[e]))}return r.join(" ")}function h(i){const{isNegative:s,integerPart:g,decimalPart:c}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(g,f,c);let l="";return s&&(l=a+" "),l+=d(g),c&&(l+=" ਦਸ਼ਮਲਵ "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=u,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=d(BigInt(r))),n}(c)),l}function p(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,m),(i=r)>=1n&&i<=6n?g[Number(i)]:d(i)+"ਵਾਂ";var i}function N(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,b);let u="";return t&&(u=a+" "),(r>0n||0n===s)&&(u+=d(r),u+=" "+(1n===r?"ਰੁਪਇਆ":"ਰੁਪਏ")),s>0n&&(r>0n&&(u+=" "),u+=d(s),u+=" "+(1n===s?"ਪੈਸਾ":"ਪੈਸੇ")),u}export{f as cardinalMax,b as currencyMax,m as ordinalMax,h as toCardinal,N as toCurrency,p as toOrdinal};
|
package/dist/pa-IN.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/pa-IN v5.1.
|
|
1
|
+
/*! n2words/pa-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3+2*(e-1))}const a="ਸਿਫ਼ਰ",c="ਮਾਇਨਸ",g=["","ਪਹਿਲਾ","ਦੂਜਾ","ਤੀਜਾ","ਚੌਥਾ","ਪੰਜਵਾਂ","ਛੇਵਾਂ"],f=["ਸਿਫ਼ਰ","ਇੱਕ","ਦੋ","ਤਿੰਨ","ਚਾਰ","ਪੰਜ","ਛੇ","ਸੱਤ","ਅੱਠ","ਨੌਂ","ਦੱਸ","ਗਿਆਰਾਂ","ਬਾਰਾਂ","ਤੇਰਾਂ","ਚੌਦਾਂ","ਪੰਦਰਾਂ","ਸੋਲਾਂ","ਸਤਾਰਾਂ","ਅਠਾਰਾਂ","ਉੱਨੀ","ਵੀਹ","ਇੱਕੀ","ਬਾਈ","ਤੇਈ","ਚੌਬੀ","ਪੱਚੀ","ਛੱਬੀ","ਸਤਾਈ","ਅਠਾਈ","ਉਨੱਤੀ","ਤੀਹ","ਇਕੱਤੀ","ਬੱਤੀ","ਤੇਤੀ","ਚੌਂਤੀ","ਪੈਂਤੀ","ਛੱਤੀ","ਸੈਂਤੀ","ਅਠੱਤੀ","ਉਨਤਾਲੀ","ਚਾਲੀ","ਇਕਤਾਲੀ","ਬਿਆਲੀ","ਤਿਰਤਾਲੀ","ਚੁਵਾਲੀ","ਪੰਤਾਲੀ","ਛਿਆਲੀ","ਸੈਂਤਾਲੀ","ਅਠਤਾਲੀ","ਉਨੰਜਾ","ਪੰਜਾਹ","ਇਕਵੰਜਾ","ਬਵੰਜਾ","ਤਰਵੰਜਾ","ਚੁਰਵੰਜਾ","ਪੰਜਵੰਜਾ","ਛਪੰਜਾ","ਸੱਤਵੰਜਾ","ਅਠਵੰਜਾ","ਉਨਾਹਠ","ਸੱਠ","ਇਕਾਹਠ","ਬਾਹਠ","ਤਰਸਠ","ਚੌਂਸਠ","ਪੈਂਸਠ","ਛਿਆਸਠ","ਸੜਸਠ","ਅੜਸਠ","ਉਣਹੱਤਰ","ਸਤੱਰ","ਇਕਹੱਤਰ","ਬਹੱਤਰ","ਤਹੱਤਰ","ਚੌਹੱਤਰ","ਪੰਝਹੱਤਰ","ਛਿਹੱਤਰ","ਸਤੱਤਰ","ਅਠੱਤਰ","ਉਨਾਸੀ","ਅੱਸੀ","ਇਕਿਆਸੀ","ਬਿਆਸੀ","ਤਰਿਆਸੀ","ਚੌਰਿਆਸੀ","ਪਚਾਸੀ","ਛਿਆਸੀ","ਸੱਤਾਸੀ","ਅਠਾਸੀ","ਨਵਾਸੀ","ਨੱਬੇ","ਇਕਾਨਵੇਂ","ਬਾਨਵੇਂ","ਤਰਾਨਵੇਂ","ਚੁਰਾਨਵੇਂ","ਪੰਚਾਨਵੇਂ","ਛਿਆਨਵੇਂ","ਸਤਾਨਵੇਂ","ਅਠਾਨਵੇਂ","ਨਿਨਾਨਵੇਂ"],l=["","ਹਜ਼ਾਰ","ਲੱਖ","ਕਰੋੜ","ਅਰਬ","ਖਰਬ","ਨੀਲ","ਪਦਮ","ਸ਼ੰਖ"],d=u(l.length),b=u(l.length),m=u(l.length);function p(e){if(0===e)return"";if(e<100)return f[e];const n=Math.trunc(e/100),t=e%100;return 0===t?f[n]+" ਸੌ":f[n]+" ਸੌ "+f[t]}function h(e){if(0n===e)return a;if(e<1000n)return p(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?p(t):f[t]),e>0&&l[e]&&r.push(l[e]))}return r.join(" ")}const w={paIN:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,b),(i=t)>=1n&&i<=6n?g[Number(i)]:h(i)+"ਵਾਂ";var i}};e.currency={paIN:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,m);let u="";return n&&(u=c+" "),(r>0n||0n===i)&&(u+=h(r),u+=" "+(1n===r?"ਰੁਪਇਆ":"ਰੁਪਏ")),i>0n&&(r>0n&&(u+=" "),u+=h(i),u+=" "+(1n===i?"ਪੈਸਾ":"ਪੈਸੇ")),u}},e.ordinal=w,e.paIN=function(e){const{isNegative:o,integerPart:u,decimalPart:g}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,d,g);let f="";return o&&(f=c+" "),f+=h(u),g&&(f+=" ਦਸ਼ਮਲਵ "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=a,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=h(BigInt(r))),n}(g)),f}},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
|
package/dist/pl-PL.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/pl-PL v5.1.
|
|
1
|
+
/*! n2words/pl-PL v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const i=parseInt(t,10);let r="";"-"===n[0]&&(r="-",n=n.slice(1));const s=n.indexOf("."),o=-1===s?n:n.slice(0,s)+n.slice(s+1),c=(-1===s?n.length:s)+i;return c>=o.length?r+o+"0".repeat(c-o.length):c<=0?r+"0."+"0".repeat(-c)+o:r+o.slice(0,c)+"."+o.slice(c)}function n(n){const i=n.toString();return t(i)?e(i):i}function t(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const i=e.slice(0,t)||"0",r=e.slice(t+1);return{isNegative:n,integerPart:BigInt(i),decimalPart:r}}function r(n){let i=n.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid currency format: "${n}"`);t(i)&&(i=e(i));const r="-"===i[0];r&&(i=i.slice(1));const s=i.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(i),cents:0n};const o=i.slice(0,s)||"0",c=(i.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(c)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const i=n.toString().length-1,r=n===10n**BigInt(i)?`10^${i} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function o(e){return 10n**BigInt(3*(e+1))}const c=["","jeden","dwa","trzy","cztery","pięć","sześć","siedem","osiem","dziewięć"],u=["","jedna","dwie","trzy","cztery","pięć","sześć","siedem","osiem","dziewięć"],a=["dziesięć","jedenaście","dwanaście","trzynaście","czternaście","piętnaście","szesnaście","siedemnaście","osiemnaście","dziewiętnaście"],l=["","","dwadzieścia","trzydzieści","czterdzieści","pięćdziesiąt","sześćdziesiąt","siedemdziesiąt","osiemdziesiąt","dziewięćdziesiąt"],f=["","sto","dwieście","trzysta","czterysta","pięćset","sześćset","siedemset","osiemset","dziewięćset"],d={1:["tysiąc","tysiące","tysięcy"],2:["milion","miliony","milionów"],3:["miliard","miliardy","miliardów"],4:["bilion","biliony","bilionów"],5:["biliard","biliardy","biliardów"],6:["trylion","tryliony","trylionów"],7:["tryliard","tryliardy","tryliardów"],8:["kwadrylion","kwadryliony","kwadrylionów"],9:["kwaryliard","kwadryliardy","kwadryliardów"],10:["kwintylion","kwintyliony","kwintylionów"]},y="zero",g="minus",w=["","pierwszy","drugi","trzeci","czwarty","piąty","szósty","siódmy","ósmy","dziewiąty"],m=["dziesiąty","jedenasty","dwunasty","trzynasty","czternasty","piętnasty","szesnasty","siedemnasty","osiemnasty","dziewiętnasty"],p=["","","dwudziesty","trzydziesty","czterdziesty","pięćdziesiąty","sześćdziesiąty","siedemdziesiąty","osiemdziesiąty","dziewięćdziesiąty"],b=["","setny","dwusetny","trzechsetny","czterechsetny","pięćsetny","sześćsetny","siedemsetny","osiemsetny","dziewięćsetny"],h=["tysięczny","milionowy","miliardowy","bilionowy","biliardowy","trylionowy","tryliardowy"],z=["złoty","złote","złotych"],N=["grosz","grosze","groszy"];function v(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,i=Math.trunc(e/100),r=[];return i>0&&r.push(f[i]),1===t?r.push(a[n]):(t>=2&&r.push(l[t]),n>0&&r.push(c[n])),r.join(" ")}function I(e,n){if(1n===e)return n[0];const t=e%10n,i=e%100n;return t>=2n&&t<=4n&&(i<10n||i>20n)?n[1]:n[2]}function O(e,n){if(0n===e)return y;if(e<1000n)return"feminine"===n?function(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,i=Math.trunc(e/100),r=[];return i>0&&r.push(f[i]),1===t?r.push(a[n]):(t>=2&&r.push(l[t]),n>0&&r.push(u[n])),r.join(" ")}(Number(e)):v(Number(e));if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n),i=I(BigInt(n),d[1]);let r;return r=1===n?i:v(n)+" "+i,t>0&&(r+=" "+v(t)),r}return function(e){const n=[];let t=e;for(;t>0n;)n.push(t%1000n),t/=1000n;let i="";for(let e=n.length-1;e>=0;e--){const t=n[e];if(0n===t)continue;const r=v(Number(t));if(i&&(i+=" "),0===e)i+=r;else{const n=d[e];if(n){const e=I(t,n);i+=1n===t?e:r+" "+e}}}return i}(e)}const E=Math.max(...Object.keys(d).map(Number)),B=o(E),j=o(h.length),R=o(E),$={gender:"masculine"},k={gender:["masculine","feminine"]};function x(r,o){const{isNegative:c,integerPart:u,decimalPart:a}=function(r){const s=typeof r;if("bigint"==typeof r)return r<0n?{isNegative:!0,integerPart:-r}:{isNegative:!1,integerPart:r};if("number"==typeof r){if(!Number.isFinite(r))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(r)?r<0?{isNegative:!0,integerPart:BigInt(-r)}:{isNegative:!1,integerPart:BigInt(r)}:i(n(r))}if("string"==typeof r)return i(function(n){const i=n.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid number format: "${n}"`);return t(i)?e(i):i}(r));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(r);s(u,B,a);const{gender:l}=function(e,n,t){const i={...n};if(void 0===e)return i;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(n);for(const[s,o]of Object.entries(e)){if(!Object.hasOwn(n,s))throw new TypeError(`Unknown option "${s}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof i[s])throw new TypeError(`Option "${s}" must be a ${typeof i[s]}, got ${typeof o}`);if(void 0!==t&&Object.hasOwn(t,s)){const e=t[s];if(!e.includes(o))throw new RangeError(`Option "${s}" must be one of: ${e.join(", ")} — got ${JSON.stringify(o)}`)}i[s]=o}}return i}(o,$,k);let f="";return c&&(f=g+" "),f+=O(u,l),a&&(f+=" przecinek "+function(e,n){let t="",i=0;for(;i<e.length&&"0"===e[i];)t&&(t+=" "),t+=y,i++;const r=e.slice(i);return r&&(t&&(t+=" "),t+=O(BigInt(r),n)),t}(a,l)),f}function P(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10);return 0===t?w[n]:1===t?m[n]:0===n?p[t]:p[t]+" "+w[n]}function M(e){if(e<100n)return P(Number(e));if(e<1000n){const n=Number(e),t=Math.trunc(n/100),i=n%100;return 0===i?b[t]:f[t]+" "+P(i)}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);if(0===t)return 1===n?h[0]:v(n)+" "+h[0];const i=I(BigInt(n),d[1]);return(1===n?"":v(n)+" ")+i+" "+M(BigInt(t))}return function(e){const n=e.toString(),t=n.length,i=[],r=t%3;let s=0;for(r>0&&(i.push(Number(n.slice(0,r))),s=r);s<t;)i.push(Number(n.slice(s,s+3))),s+=3;let o=i.length-1;for(;o>=0&&0===i[o];)o--;const c=[];let u=i.length-1;for(let e=0;e<i.length;e++){const n=i[e];if(0!==n){const t=e===o;if(0===u)c.push(t?M(BigInt(n)):v(n));else if(t)c.push(1===n?h[u-1]:v(n)+" "+h[u-1]);else{const e=d[u],t=e?I(BigInt(n),e):"";c.push(1===n?t:v(n)+" "+t)}}u--}return c.join(" ")}(e)}function S(n){const i=function(n){const i=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const i=n.trim();if(0===i.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===i[0])throw new RangeError("Ordinals cannot be negative");if(i.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(i)){const n=e(i);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(i);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${i}`)}(n);return s(i,j),M(i)}function T(e){const{isNegative:t,dollars:i,cents:o}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:r(n(e))}if("string"==typeof e)return r(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);s(i,R);let c="";return t&&(c=g+" "),(i>0n||0n===o)&&(c+=O(i,"masculine"),c+=" "+I(i,z)),o>0n&&(i>0n&&(c+=" "),c+=O(o,"masculine"),c+=" "+I(o,N)),c}export{$ as cardinalDefaults,B as cardinalMax,k as cardinalValues,R as currencyMax,j as ordinalMax,x as toCardinal,T as toCurrency,S as toOrdinal};
|
package/dist/pl-PL.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/pl-PL v5.1.
|
|
1
|
+
/*! n2words/pl-PL v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const i=parseInt(t,10);let r="";"-"===n[0]&&(r="-",n=n.slice(1));const s=n.indexOf("."),o=-1===s?n:n.slice(0,s)+n.slice(s+1),c=(-1===s?n.length:s)+i;return c>=o.length?r+o+"0".repeat(c-o.length):c<=0?r+"0."+"0".repeat(-c)+o:r+o.slice(0,c)+"."+o.slice(c)}function t(e){const t=e.toString();return i(t)?n(t):t}function i(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const i=e.slice(0,t)||"0",r=e.slice(t+1);return{isNegative:n,integerPart:BigInt(i),decimalPart:r}}function s(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);i(t)&&(t=n(t));const r="-"===t[0];r&&(t=t.slice(1));const s=t.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(t),cents:0n};const o=t.slice(0,s)||"0",c=(t.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(c)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const i=n.toString().length-1,r=n===10n**BigInt(i)?`10^${i} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function c(e){return 10n**BigInt(3*(e+1))}const u=["","jeden","dwa","trzy","cztery","pięć","sześć","siedem","osiem","dziewięć"],a=["","jedna","dwie","trzy","cztery","pięć","sześć","siedem","osiem","dziewięć"],l=["dziesięć","jedenaście","dwanaście","trzynaście","czternaście","piętnaście","szesnaście","siedemnaście","osiemnaście","dziewiętnaście"],f=["","","dwadzieścia","trzydzieści","czterdzieści","pięćdziesiąt","sześćdziesiąt","siedemdziesiąt","osiemdziesiąt","dziewięćdziesiąt"],d=["","sto","dwieście","trzysta","czterysta","pięćset","sześćset","siedemset","osiemset","dziewięćset"],y={1:["tysiąc","tysiące","tysięcy"],2:["milion","miliony","milionów"],3:["miliard","miliardy","miliardów"],4:["bilion","biliony","bilionów"],5:["biliard","biliardy","biliardów"],6:["trylion","tryliony","trylionów"],7:["tryliard","tryliardy","tryliardów"],8:["kwadrylion","kwadryliony","kwadrylionów"],9:["kwaryliard","kwadryliardy","kwadryliardów"],10:["kwintylion","kwintyliony","kwintylionów"]},g="zero",w="minus",m=["","pierwszy","drugi","trzeci","czwarty","piąty","szósty","siódmy","ósmy","dziewiąty"],p=["dziesiąty","jedenasty","dwunasty","trzynasty","czternasty","piętnasty","szesnasty","siedemnasty","osiemnasty","dziewiętnasty"],b=["","","dwudziesty","trzydziesty","czterdziesty","pięćdziesiąty","sześćdziesiąty","siedemdziesiąty","osiemdziesiąty","dziewięćdziesiąty"],h=["","setny","dwusetny","trzechsetny","czterechsetny","pięćsetny","sześćsetny","siedemsetny","osiemsetny","dziewięćsetny"],z=["tysięczny","milionowy","miliardowy","bilionowy","biliardowy","trylionowy","tryliardowy"],N=["złoty","złote","złotych"],v=["grosz","grosze","groszy"];function I(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,i=Math.trunc(e/100),r=[];return i>0&&r.push(d[i]),1===t?r.push(l[n]):(t>=2&&r.push(f[t]),n>0&&r.push(u[n])),r.join(" ")}function O(e,n){if(1n===e)return n[0];const t=e%10n,i=e%100n;return t>=2n&&t<=4n&&(i<10n||i>20n)?n[1]:n[2]}function E(e,n){if(0n===e)return g;if(e<1000n)return"feminine"===n?function(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,i=Math.trunc(e/100),r=[];return i>0&&r.push(d[i]),1===t?r.push(l[n]):(t>=2&&r.push(f[t]),n>0&&r.push(a[n])),r.join(" ")}(Number(e)):I(Number(e));if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n),i=O(BigInt(n),y[1]);let r;return r=1===n?i:I(n)+" "+i,t>0&&(r+=" "+I(t)),r}return function(e){const n=[];let t=e;for(;t>0n;)n.push(t%1000n),t/=1000n;let i="";for(let e=n.length-1;e>=0;e--){const t=n[e];if(0n===t)continue;const r=I(Number(t));if(i&&(i+=" "),0===e)i+=r;else{const n=y[e];if(n){const e=O(t,n);i+=1n===t?e:r+" "+e}}}return i}(e)}const B=Math.max(...Object.keys(y).map(Number)),j=c(B),R=c(z.length),$=c(B),k={gender:"masculine"},P={gender:["masculine","feminine"]};function x(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10);return 0===t?m[n]:1===t?p[n]:0===n?b[t]:b[t]+" "+m[n]}function T(e){if(e<100n)return x(Number(e));if(e<1000n){const n=Number(e),t=Math.trunc(n/100),i=n%100;return 0===i?h[t]:d[t]+" "+x(i)}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);if(0===t)return 1===n?z[0]:I(n)+" "+z[0];const i=O(BigInt(n),y[1]);return(1===n?"":I(n)+" ")+i+" "+T(BigInt(t))}return function(e){const n=e.toString(),t=n.length,i=[],r=t%3;let s=0;for(r>0&&(i.push(Number(n.slice(0,r))),s=r);s<t;)i.push(Number(n.slice(s,s+3))),s+=3;let o=i.length-1;for(;o>=0&&0===i[o];)o--;const c=[];let u=i.length-1;for(let e=0;e<i.length;e++){const n=i[e];if(0!==n){const t=e===o;if(0===u)c.push(t?T(BigInt(n)):I(n));else if(t)c.push(1===n?z[u-1]:I(n)+" "+z[u-1]);else{const e=y[u],t=e?O(BigInt(n),e):"";c.push(1===n?t:I(n)+" "+t)}}u--}return c.join(" ")}(e)}const M={plPL:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(i(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const i=BigInt(e);if(i<=0n)throw new RangeError("Ordinals must be positive integers");return i}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return o(t,R),T(t)}};e.currency={plPL:function(e){const{isNegative:n,dollars:i,cents:r}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:s(t(e))}if("string"==typeof e)return s(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);o(i,$);let c="";return n&&(c=w+" "),(i>0n||0n===r)&&(c+=E(i,"masculine"),c+=" "+O(i,N)),r>0n&&(i>0n&&(c+=" "),c+=E(r,"masculine"),c+=" "+O(r,v)),c}},e.ordinal=M,e.plPL=function(e,s){const{isNegative:c,integerPart:u,decimalPart:a}=function(e){const s=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:r(t(e))}if("string"==typeof e)return r(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return i(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(e);o(u,j,a);const{gender:l}=function(e,n,t){const i={...n};if(void 0===e)return i;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(n);for(const[s,o]of Object.entries(e)){if(!Object.hasOwn(n,s))throw new TypeError(`Unknown option "${s}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof i[s])throw new TypeError(`Option "${s}" must be a ${typeof i[s]}, got ${typeof o}`);if(void 0!==t&&Object.hasOwn(t,s)){const e=t[s];if(!e.includes(o))throw new RangeError(`Option "${s}" must be one of: ${e.join(", ")} — got ${JSON.stringify(o)}`)}i[s]=o}}return i}(s,k,P);let f="";return c&&(f=w+" "),f+=E(u,l),a&&(f+=" przecinek "+function(e,n){let t="",i=0;for(;i<e.length&&"0"===e[i];)t&&(t+=" "),t+=g,i++;const r=e.slice(i);return r&&(t&&(t+=" "),t+=E(BigInt(r),n)),t}(a,l)),f}},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
|
package/dist/pt-BR.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! n2words/pt-BR v5.1.
|
|
1
|
+
/*! n2words/pt-BR v5.1.1 | MIT License | github.com/forzagreen/n2words */
|
|
2
2
|
function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3*(e+1))}const u=["","um","dois","três","quatro","cinco","seis","sete","oito","nove"],c=["dez","onze","doze","treze","quatorze","quinze","dezesseis","dezessete","dezoito","dezenove"],a=["","","vinte","trinta","quarenta","cinquenta","sessenta","setenta","oitenta","noventa"],l=["","cento","duzentos","trezentos","quatrocentos","quinhentos","seiscentos","setecentos","oitocentos","novecentos"],f="mil",m="zero",g="menos",d=["","primeiro","segundo","terceiro","quarto","quinto","sexto","sétimo","oitavo","nono"],h=["décimo","décimo primeiro","décimo segundo","décimo terceiro","décimo quarto","décimo quinto","décimo sexto","décimo sétimo","décimo oitavo","décimo nono"],p=["","","vigésimo","trigésimo","quadragésimo","quinquagésimo","sexagésimo","septuagésimo","octogésimo","nonagésimo"],b=["","centésimo","ducentésimo","tricentésimo","quadringentésimo","quingentésimo","sexcentésimo","septingentésimo","octingentésimo","nongentésimo"],w={BRL:{major:["real","reais"],minor:["centavo","centavos"]},USD:{major:["dólar","dólares"],minor:["centavo","centavos"]},EUR:{major:["euro","euros"],minor:["centavo","centavos"]},GBP:{major:["libra","libras"],minor:["pêni","pence"]},JPY:{major:["iene","ienes"],minor:["sen","sen"]}},v={minor:["centavo","centavos"]};function N(e){if(0===e)return{word:"",isExactHundred:!1};if(100===e)return{word:"cem",isExactHundred:!0};const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100),i=[];return r>0&&i.push(l[r]),1===t?i.push(c[n]):t>=2?i.push(n>0?a[t]+" e "+u[n]:a[t]):n>0&&i.push(u[n]),{word:i.join(" e "),isExactHundred:r>0&&0===t&&0===n,startsWithHundreds:e>=100}}const y=["",f,"milhão","bilhão","trilhão","quatrilhão","quintilhão","sextilhão","setilhão"],E=["",f,"milhões","bilhões","trilhões","quatrilhões","quintilhões","sextilhões","setilhões"],I=["","milésimo","milionésimo","bilionésimo","trilionésimo","quatrilionésimo","quintilionésimo","sextilionésimo"],q=s(y.length-1),x=s(I.length-1),O=s(y.length-1);function R(e){if(0n===e)return m;if(e<1000n)return N(Number(e)).word;if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r;if(r=1===n?f:N(n).word+" "+f,t>0){const e=N(t);r+=!e.startsWithHundreds||e.isExactHundred?" e "+e.word:" "+e.word}return r}return function(e){const n=[];let t=e;for(;t>0n;)n.push(Number(t%1000n)),t/=1000n;let r=0;for(let e=0;e<n.length;e++)if(0!==n[e]){r=e;break}let i="",o=!1;for(let e=n.length-1;e>=0;e--){const t=n[e];if(0===t)continue;const s=N(t);if(i&&e===r&&o&&(!s.startsWithHundreds||s.isExactHundred)&&(i+=" e"),i&&(i+=" "),0===e)i+=s.word,o=!1;else if(1===e)i+=1===t?f:s.word+" "+f,o=!0;else{const n=1===t?y[e]:E[e];i+=1===t?"um "+n:s.word+" "+n,o=!0}}return i}(e)}function B(i){const{isNegative:s,integerPart:u,decimalPart:c}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(u,q,c);let a="";return s&&(a=g+" "),a+=R(u),c&&(a+=" vírgula "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=m,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=R(BigInt(r))),n}(c)),a}function j(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100),i=[];return r>0&&i.push(b[r]),1===t?i.push(h[n]):t>=2?(i.push(p[t]),n>0&&i.push(d[n])):n>0&&i.push(d[n]),i.join(" ")}function z(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);if(o(r,x),r<10n)return d[Number(r)];if(r<20n)return h[Number(r)-10];if(r<100n){const e=Number(r%10n),n=Number(r/10n);return 0===e?p[n]:p[n]+" "+d[e]}return r<1000n?j(Number(r)):function(e){const n=[];let t=e;for(;t>0n;)n.push(Number(t%1000n)),t/=1000n;let r=0;for(let e=0;e<n.length;e++)if(0!==n[e]){r=e;break}let i="";for(let e=n.length-1;e>=0;e--){const t=n[e];if(0!==t)if(i&&(i+=" "),e===r)i+=0===e?j(t):1===t&&e>0?I[e]:j(t)+" "+I[e];else if(0===e)i+=N(t).word;else if(1===e)i+=1===t?f:N(t).word+" "+f;else{const n=1===t?y[e]:E[e];i+=1===t?"um "+n:N(t).word+" "+n}}return i}(r)}const $={and:!0,currency:""};function P(e,t){const{isNegative:r,dollars:s,cents:u}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(s,O);const{and:c,currency:a}=function(e,n){const t={...n};if(void 0===e)return t;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(n);for(const[i,o]of Object.entries(e)){if(!Object.hasOwn(n,i))throw new TypeError(`Unknown option "${i}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof t[i])throw new TypeError(`Option "${i}" must be a ${typeof t[i]}, got ${typeof o}`);t[i]=o}}return t}(t,$);let l=a;if(!l){try{const e=new Intl.Locale("pt-BR");l=e.getCurrencies?.()[0]}catch{}l=l||"BRL"}l=l.toUpperCase();const f=w[l]||{major:[l,l],minor:v.minor};let d="";r&&(d=g+" ");const h=s>0n,p=u>0n;if(!h&&!p)return m+" "+f.major[1];if(h&&(d+=R(s)+" "+(1n===s?f.major[0]:f.major[1])),p){h&&(d+=c?" e ":" ");const e=R(u),n=1n===u?f.minor[0]:f.minor[1];d+=""===n?e:e+" "+n}return d}export{q as cardinalMax,$ as currencyDefaults,O as currencyMax,x as ordinalMax,B as toCardinal,P as toCurrency,z as toOrdinal};
|