n2words 5.1.1 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2 -2
- package/dist/hr-HR.umd.js +2 -2
- 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 +1 -1
- package/dist/sr-Cyrl-RS.umd.js +1 -1
- package/dist/sr-Latn-RS.js +1 -1
- package/dist/sr-Latn-RS.umd.js +1 -1
- 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/am-ET.d.ts +19 -6
- package/src/am-Latn-ET.d.ts +19 -6
- package/src/ar-SA.d.ts +46 -32
- package/src/az-AZ.d.ts +17 -6
- package/src/bn-BD.d.ts +18 -6
- package/src/cs-CZ.d.ts +19 -6
- package/src/da-DK.d.ts +19 -6
- package/src/de-DE.d.ts +30 -16
- package/src/el-GR.d.ts +18 -6
- package/src/en-AU.d.ts +27 -16
- package/src/en-BD.d.ts +28 -16
- package/src/en-CA.d.ts +46 -25
- package/src/en-GB.d.ts +28 -16
- package/src/en-GH.d.ts +35 -16
- package/src/en-IE.d.ts +38 -16
- package/src/en-IN.d.ts +28 -16
- package/src/en-KE.d.ts +35 -16
- package/src/en-MY.d.ts +38 -16
- package/src/en-NG.d.ts +38 -16
- package/src/en-NZ.d.ts +35 -16
- package/src/en-PH.d.ts +35 -16
- package/src/en-PK.d.ts +28 -16
- package/src/en-SG.d.ts +35 -16
- package/src/en-US.d.ts +44 -25
- package/src/en-ZA.d.ts +37 -16
- package/src/es-ES.d.ts +61 -42
- package/src/es-MX.d.ts +61 -42
- package/src/es-US.d.ts +61 -42
- package/src/fa-IR.d.ts +17 -6
- package/src/fi-FI.d.ts +19 -6
- package/src/fil-PH.d.ts +18 -6
- package/src/fr-BE.d.ts +35 -23
- package/src/fr-FR.d.ts +36 -23
- package/src/gu-IN.d.ts +19 -6
- package/src/ha-NG.d.ts +21 -6
- package/src/hbo-IL.d.ts +30 -17
- package/src/he-IL.d.ts +24 -11
- package/src/hi-IN.d.ts +19 -6
- package/src/hr-HR.d.ts +28 -15
- package/src/hr-HR.js +8 -6
- package/src/hu-HU.d.ts +18 -6
- package/src/id-ID.d.ts +18 -6
- package/src/it-IT.d.ts +30 -16
- package/src/ja-JP.d.ts +18 -6
- package/src/ka-GE.d.ts +20 -6
- package/src/kn-IN.d.ts +19 -6
- package/src/ko-KR.d.ts +18 -6
- package/src/lt-LT.d.ts +27 -15
- package/src/lv-LV.d.ts +28 -15
- package/src/mr-IN.d.ts +19 -6
- package/src/ms-MY.d.ts +18 -6
- package/src/nb-NO.d.ts +18 -6
- package/src/nl-NL.d.ts +42 -27
- package/src/pa-IN.d.ts +18 -6
- package/src/pl-PL.d.ts +28 -15
- package/src/pt-BR.d.ts +34 -21
- package/src/pt-PT.d.ts +29 -16
- package/src/ro-RO.d.ts +27 -15
- package/src/ru-RU.d.ts +38 -26
- package/src/sr-Cyrl-RS.d.ts +40 -26
- package/src/sr-Latn-RS.d.ts +40 -26
- package/src/sv-SE.d.ts +19 -6
- package/src/sw-KE.d.ts +17 -6
- package/src/ta-IN.d.ts +21 -6
- package/src/te-IN.d.ts +19 -6
- package/src/th-TH.d.ts +19 -6
- package/src/tr-TR.d.ts +22 -11
- package/src/uk-UA.d.ts +27 -15
- package/src/ur-PK.d.ts +18 -6
- package/src/utils/check-max.d.ts +1 -1
- package/src/utils/expand-scientific.d.ts +3 -3
- package/src/utils/is-plain-object.d.ts +1 -1
- package/src/utils/parse-cardinal.d.ts +7 -1
- package/src/utils/parse-currency.d.ts +6 -1
- package/src/utils/parse-ordinal.d.ts +6 -1
- package/src/utils/resolve-options.d.ts +1 -1
- package/src/utils/scale.d.ts +22 -22
- package/src/vi-VN.d.ts +17 -6
- package/src/yo-NG.d.ts +24 -6
- package/src/zh-Hans-CN.d.ts +46 -34
- package/src/zh-Hant-TW.d.ts +50 -34
package/src/ur-PK.d.ts
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Urdu (Pakistan) language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: ur-PK | Urdu as used in Pakistan
|
|
5
|
+
*
|
|
6
|
+
* Key features:
|
|
7
|
+
* - Indian numbering system (ہزار, لاکھ, کروڑ)
|
|
8
|
+
* - Urdu script (right-to-left)
|
|
9
|
+
* - 3-2-2 grouping pattern (last 3 digits, then groups of 2)
|
|
10
|
+
* - Complete word forms for 0-99
|
|
11
|
+
*/
|
|
12
|
+
export declare const cardinalMax: bigint;
|
|
13
|
+
export declare const ordinalMax: bigint;
|
|
14
|
+
export declare const currencyMax: bigint;
|
|
4
15
|
/**
|
|
5
16
|
* Converts a numeric value to Urdu words.
|
|
6
17
|
* @param {number | string | bigint} value - The numeric value to convert
|
|
7
18
|
* @returns {string} The number in Urdu words
|
|
8
19
|
*/
|
|
9
|
-
|
|
20
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
10
21
|
/**
|
|
11
22
|
* Converts a numeric value to Urdu ordinal words.
|
|
12
23
|
* @param {number | string | bigint} value - The numeric value to convert (positive integer)
|
|
@@ -19,7 +30,7 @@ export function toCardinal(value: number | string | bigint): string;
|
|
|
19
30
|
* toOrdinal(3) // 'تیسرا'
|
|
20
31
|
* toOrdinal(10) // 'دسواں'
|
|
21
32
|
*/
|
|
22
|
-
|
|
33
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
23
34
|
/**
|
|
24
35
|
* Converts a numeric value to Urdu currency words (Pakistani Rupee).
|
|
25
36
|
* @param {number | string | bigint} value - The currency amount to convert
|
|
@@ -31,4 +42,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
31
42
|
* toCurrency(1) // 'ایک روپیہ'
|
|
32
43
|
* toCurrency(0.01) // 'ایک پیسہ'
|
|
33
44
|
*/
|
|
34
|
-
|
|
45
|
+
declare function toCurrency(value: number | string | bigint): string;
|
|
46
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/utils/check-max.d.ts
CHANGED
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
* currency forms omit it so long fractions stay valid.
|
|
24
24
|
* @throws {RangeError} when the value is out of range
|
|
25
25
|
*/
|
|
26
|
-
export function checkMax(value: bigint, max: bigint | null, fraction?: string): void;
|
|
26
|
+
export declare function checkMax(value: bigint, max: bigint | null, fraction?: string): void;
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
* expandScientificNotation("1.5e3") // "1500"
|
|
14
14
|
* expandScientificNotation("1e-3") // "0.001"
|
|
15
15
|
*/
|
|
16
|
-
export function expandScientificNotation(str: string): string;
|
|
16
|
+
export declare function expandScientificNotation(str: string): string;
|
|
17
17
|
/**
|
|
18
18
|
* Converts a number to decimal string, expanding scientific notation if needed.
|
|
19
19
|
* @param {number} value - The number to convert
|
|
20
20
|
* @returns {string} Decimal string representation
|
|
21
21
|
*/
|
|
22
|
-
export function numberToString(value: number): string;
|
|
22
|
+
export declare function numberToString(value: number): string;
|
|
23
23
|
/**
|
|
24
24
|
* Checks if a string contains scientific notation.
|
|
25
25
|
* @param {string} str - String to check
|
|
26
26
|
* @returns {boolean} True if string contains 'e' or 'E'
|
|
27
27
|
*/
|
|
28
|
-
export function hasScientificNotation(str: string): boolean;
|
|
28
|
+
export declare function hasScientificNotation(str: string): boolean;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cardinal value parsing utility.
|
|
3
|
+
* Transforms user input (number, string, or bigint) into normalized components.
|
|
4
|
+
* Handles negatives, decimals, and scientific notation.
|
|
5
|
+
* @module parse-cardinal
|
|
6
|
+
*/
|
|
1
7
|
/**
|
|
2
8
|
* Parses a value for cardinal conversion.
|
|
3
9
|
* Cardinals accept any numeric value: integers, decimals, negatives.
|
|
@@ -6,7 +12,7 @@
|
|
|
6
12
|
* @throws {TypeError} If value is not number, string, or bigint
|
|
7
13
|
* @throws {RangeError} If value is not finite
|
|
8
14
|
*/
|
|
9
|
-
export function parseCardinalValue(value: number | string | bigint): {
|
|
15
|
+
export declare function parseCardinalValue(value: number | string | bigint): {
|
|
10
16
|
isNegative: boolean;
|
|
11
17
|
integerPart: bigint;
|
|
12
18
|
decimalPart?: string;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Currency value parsing utility.
|
|
3
|
+
* Optimized parser for currency conversion - extracts dollars and cents.
|
|
4
|
+
* @module parse-currency
|
|
5
|
+
*/
|
|
1
6
|
/**
|
|
2
7
|
* Parses a value for currency conversion.
|
|
3
8
|
* Returns dollars and cents as separate bigints, plus negative flag.
|
|
@@ -6,7 +11,7 @@
|
|
|
6
11
|
* @throws {TypeError} If value is not number, string, or bigint
|
|
7
12
|
* @throws {RangeError} If value is not finite
|
|
8
13
|
*/
|
|
9
|
-
export function parseCurrencyValue(value: number | string | bigint): {
|
|
14
|
+
export declare function parseCurrencyValue(value: number | string | bigint): {
|
|
10
15
|
isNegative: boolean;
|
|
11
16
|
dollars: bigint;
|
|
12
17
|
cents: bigint;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ordinal value parsing utility.
|
|
3
|
+
* Optimized parser for ordinal conversion - accepts only positive integers.
|
|
4
|
+
* @module parse-ordinal
|
|
5
|
+
*/
|
|
1
6
|
/**
|
|
2
7
|
* Parses a value for ordinal conversion.
|
|
3
8
|
* Ordinals require positive integers only (no zero, negatives, or decimals).
|
|
@@ -6,4 +11,4 @@
|
|
|
6
11
|
* @throws {TypeError} If value is not number, string, or bigint
|
|
7
12
|
* @throws {RangeError} If value is zero, negative, or has a decimal part
|
|
8
13
|
*/
|
|
9
|
-
export function parseOrdinalValue(value: number | string | bigint): bigint;
|
|
14
|
+
export declare function parseOrdinalValue(value: number | string | bigint): bigint;
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
* @param {Partial<Record<keyof T & string, readonly unknown[]>>} [values] - Allowed set per enum-valued option
|
|
15
15
|
* @returns {Required<T>} The options with every default applied
|
|
16
16
|
*/
|
|
17
|
-
export function resolveOptions<T extends object>(options: T | undefined, defaults: Required<T>, values?: Partial<Record<keyof T & string, readonly unknown[]>>): Required<T>;
|
|
17
|
+
export declare function resolveOptions<T extends object>(options: T | undefined, defaults: Required<T>, values?: Partial<Record<keyof T & string, readonly unknown[]>>): Required<T>;
|
package/src/utils/scale.d.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scale-range helpers — pure.
|
|
3
|
+
*
|
|
4
|
+
* Each form declares its maximum supported value as a bigint export
|
|
5
|
+
* (`cardinalMax`, `ordinalMax`, `currencyMax`): the smallest value the form
|
|
6
|
+
* refuses, so the largest it converts is that minus one. `UNBOUNDED` (null)
|
|
7
|
+
* means no fixed limit.
|
|
8
|
+
*
|
|
9
|
+
* These helpers derive that bigint from a language's own scale-table size, so
|
|
10
|
+
* the ceiling tracks the vocabulary and can't drift. A language whose shape
|
|
11
|
+
* fits none of them declares the value directly (`bounded(n)` or a literal
|
|
12
|
+
* bigint). They only *produce* a max — the range check that consumes one
|
|
13
|
+
* (`checkMax`) lives in check-max.js, and the verification checks (boundary,
|
|
14
|
+
* gaps, injectivity) live in the gate. Nothing here throws.
|
|
15
|
+
*/
|
|
16
|
+
/** No fixed ceiling — recursive/compounding spellers (th-TH, fa-IR, …). */
|
|
17
|
+
export declare const UNBOUNDED: null;
|
|
1
18
|
/**
|
|
2
19
|
* 3-digit grouping, scale array starting at "thousand" (en-US, de-DE, ru-RU, …).
|
|
3
20
|
* @param {number} scaleCount Number of scale words in the table
|
|
4
21
|
* @returns {bigint} The first unsupported value (10^((scaleCount + 1) * 3))
|
|
5
22
|
*/
|
|
6
|
-
export function western(scaleCount: number): bigint;
|
|
23
|
+
export declare function western(scaleCount: number): bigint;
|
|
7
24
|
/**
|
|
8
25
|
* Myriad (4-digit) grouping — one scale word per power of 10,000 (ja-JP, ko-KR).
|
|
9
26
|
* @param {number} scaleCount Number of scale words in the table
|
|
10
27
|
* @returns {bigint} The first unsupported value
|
|
11
28
|
*/
|
|
12
|
-
export function myriad(scaleCount: number): bigint;
|
|
29
|
+
export declare function myriad(scaleCount: number): bigint;
|
|
13
30
|
/**
|
|
14
31
|
* South Asian 3-2-2 grouping: a 3-digit base segment then 2 digits per scale
|
|
15
32
|
* word, with the table's index 0 reserved for the (empty) units slot.
|
|
16
33
|
* @param {number} wordCount Length of the scale-word table (including the units slot)
|
|
17
34
|
* @returns {bigint} The first unsupported value
|
|
18
35
|
*/
|
|
19
|
-
export function indian(wordCount: number): bigint;
|
|
36
|
+
export declare function indian(wordCount: number): bigint;
|
|
20
37
|
/**
|
|
21
38
|
* Long scale — each unit (a base scale word, or a prefix) yields two levels
|
|
22
39
|
* (-illion / -illiard), spanning 6 powers of ten. es-*, fr-*, it-IT.
|
|
23
40
|
* @param {number} unitCount Number of base scale words or prefixes
|
|
24
41
|
* @returns {bigint} The first unsupported value (10^(6 * (unitCount + 1)))
|
|
25
42
|
*/
|
|
26
|
-
export function longScale(unitCount: number): bigint;
|
|
43
|
+
export declare function longScale(unitCount: number): bigint;
|
|
27
44
|
/**
|
|
28
45
|
* Escape hatch: a structural bound given as its base-10 exponent (zh: `bounded(16)`).
|
|
29
46
|
* @param {number} exponent The base-10 exponent of the ceiling
|
|
30
47
|
* @returns {bigint} 10^exponent
|
|
31
48
|
*/
|
|
32
|
-
export function bounded(exponent: number): bigint;
|
|
33
|
-
/**
|
|
34
|
-
* Scale-range helpers — pure.
|
|
35
|
-
*
|
|
36
|
-
* Each form declares its maximum supported value as a bigint export
|
|
37
|
-
* (`cardinalMax`, `ordinalMax`, `currencyMax`): the smallest value the form
|
|
38
|
-
* refuses, so the largest it converts is that minus one. `UNBOUNDED` (null)
|
|
39
|
-
* means no fixed limit.
|
|
40
|
-
*
|
|
41
|
-
* These helpers derive that bigint from a language's own scale-table size, so
|
|
42
|
-
* the ceiling tracks the vocabulary and can't drift. A language whose shape
|
|
43
|
-
* fits none of them declares the value directly (`bounded(n)` or a literal
|
|
44
|
-
* bigint). They only *produce* a max — the range check that consumes one
|
|
45
|
-
* (`checkMax`) lives in check-max.js, and the verification checks (boundary,
|
|
46
|
-
* gaps, injectivity) live in the gate. Nothing here throws.
|
|
47
|
-
*/
|
|
48
|
-
/** No fixed ceiling — recursive/compounding spellers (th-TH, fa-IR, …). */
|
|
49
|
-
export const UNBOUNDED: null;
|
|
49
|
+
export declare function bounded(exponent: number): bigint;
|
package/src/vi-VN.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Vietnamese (Vietnam) language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: vi-VN | Vietnamese as used in Vietnam
|
|
5
|
+
*
|
|
6
|
+
* Vietnamese-specific rules:
|
|
7
|
+
* - Special pronunciation: "lăm" for 5 in tens position, "mốt" for final 1
|
|
8
|
+
* - "Lẻ" (odd/extra) marker when tens place is zero after hundreds/scales
|
|
9
|
+
* - Short scale system with Vietnamese words (nghìn, triệu, tỷ)
|
|
10
|
+
*/
|
|
11
|
+
export declare const cardinalMax: bigint;
|
|
12
|
+
export declare const ordinalMax: bigint;
|
|
13
|
+
export declare const currencyMax: bigint;
|
|
4
14
|
/**
|
|
5
15
|
* Converts a numeric value to Vietnamese words.
|
|
6
16
|
*
|
|
@@ -15,7 +25,7 @@ export const currencyMax: bigint;
|
|
|
15
25
|
* toCardinal(101) // 'một trăm lẻ một'
|
|
16
26
|
* toCardinal(1000000) // 'một triệu'
|
|
17
27
|
*/
|
|
18
|
-
|
|
28
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
19
29
|
/**
|
|
20
30
|
* Converts a numeric value to Vietnamese ordinal words.
|
|
21
31
|
* @param {number | string | bigint} value - The numeric value to convert (positive integer)
|
|
@@ -27,7 +37,7 @@ export function toCardinal(value: number | string | bigint): string;
|
|
|
27
37
|
* toOrdinal(2) // 'thứ hai'
|
|
28
38
|
* toOrdinal(10) // 'thứ mười'
|
|
29
39
|
*/
|
|
30
|
-
|
|
40
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
31
41
|
/**
|
|
32
42
|
* Converts a numeric value to Vietnamese currency words (Dong).
|
|
33
43
|
*
|
|
@@ -42,4 +52,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
42
52
|
* toCurrency(1000) // 'một nghìn đồng'
|
|
43
53
|
* toCurrency(-5) // 'âm năm đồng'
|
|
44
54
|
*/
|
|
45
|
-
|
|
55
|
+
declare function toCurrency(value: number | string | bigint): string;
|
|
56
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/yo-NG.d.ts
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Yoruba (Nigeria) language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: yo-NG | Yoruba as used in Nigeria
|
|
5
|
+
*
|
|
6
|
+
* Yoruba uses a complex vigesimal (base-20) system with:
|
|
7
|
+
* - Additive patterns: 1-4 added to decade (lé = "plus")
|
|
8
|
+
* - Subtractive patterns: 5-9 subtracted from next decade (dín = "minus")
|
|
9
|
+
* - Odd decades (30,50,70,90) formed by subtracting 10 from next even decade
|
|
10
|
+
* - Even decades (20,40,60,80,100) are multiples of 20
|
|
11
|
+
*
|
|
12
|
+
* Examples:
|
|
13
|
+
* - 21 = ọ̀kan lé lógún (1 + 20)
|
|
14
|
+
* - 15 = àrùndínlógún (20 - 5)
|
|
15
|
+
* - 50 = àádọ́ta (60 - 10)
|
|
16
|
+
* - 45 = àrùndínláàádọ́ta (50 - 5)
|
|
17
|
+
*/
|
|
18
|
+
export declare const cardinalMax: null;
|
|
19
|
+
export declare const ordinalMax: null;
|
|
20
|
+
export declare const currencyMax: null;
|
|
4
21
|
/**
|
|
5
22
|
* Converts a numeric value to Yoruba words.
|
|
6
23
|
* @param {number | string | bigint} value - The numeric value to convert
|
|
7
24
|
* @returns {string} The number in Yoruba words
|
|
8
25
|
*/
|
|
9
|
-
|
|
26
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
10
27
|
/**
|
|
11
28
|
* Converts a numeric value to Yoruba ordinal words.
|
|
12
29
|
* @param {number | string | bigint} value - The numeric value to convert (positive integer)
|
|
@@ -18,7 +35,7 @@ export function toCardinal(value: number | string | bigint): string;
|
|
|
18
35
|
* toOrdinal(2) // 'ìkejì'
|
|
19
36
|
* toOrdinal(3) // 'ìkẹẹ̀ta'
|
|
20
37
|
*/
|
|
21
|
-
|
|
38
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
22
39
|
/**
|
|
23
40
|
* Converts a numeric value to Yoruba currency words (Nigerian Naira).
|
|
24
41
|
*
|
|
@@ -32,4 +49,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
32
49
|
* toCurrency(1.50) // 'ọ̀kan náírà àti àádọ́ta kọ́bọ̀'
|
|
33
50
|
* toCurrency(-5) // 'àìní àrùn náírà'
|
|
34
51
|
*/
|
|
35
|
-
|
|
52
|
+
declare function toCurrency(value: number | string | bigint): string;
|
|
53
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/zh-Hans-CN.d.ts
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
/** @type {Required<OrdinalOptions>} */
|
|
15
|
-
export const ordinalDefaults: Required<OrdinalOptions>;
|
|
16
|
-
/**
|
|
17
|
-
* @typedef {object} CurrencyOptions
|
|
18
|
-
* @property {boolean} [formal] - Use formal/financial numerals
|
|
2
|
+
* Simplified Chinese (China) language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: zh-Hans-CN | Simplified Chinese as used in China
|
|
5
|
+
*
|
|
6
|
+
* Key features:
|
|
7
|
+
* - Myriad-based (万, 亿) grouping - 4 digits
|
|
8
|
+
* - Formal (financial) vs common numerals
|
|
9
|
+
* - Zero insertion for skipped positions
|
|
10
|
+
* - No word separators (concatenated format)
|
|
19
11
|
*/
|
|
20
|
-
|
|
21
|
-
export const
|
|
12
|
+
export declare const cardinalMax: bigint;
|
|
13
|
+
export declare const ordinalMax: bigint;
|
|
14
|
+
export declare const currencyMax: bigint;
|
|
22
15
|
export type CardinalOptions = {
|
|
23
16
|
/**
|
|
24
17
|
* - Use formal/financial numerals
|
|
25
18
|
*/
|
|
26
|
-
formal?: boolean
|
|
19
|
+
formal?: boolean;
|
|
27
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {object} CardinalOptions
|
|
23
|
+
* @property {boolean} [formal] - Use formal/financial numerals
|
|
24
|
+
*/
|
|
25
|
+
/** @type {Required<CardinalOptions>} */
|
|
26
|
+
export declare const cardinalDefaults: Required<CardinalOptions>;
|
|
27
|
+
/**
|
|
28
|
+
* Converts a numeric value to Simplified Chinese words.
|
|
29
|
+
* @param {number | string | bigint} value - The numeric value to convert
|
|
30
|
+
* @param {CardinalOptions} [options] - Optional configuration
|
|
31
|
+
* @returns {string} The number in Simplified Chinese words
|
|
32
|
+
*/
|
|
33
|
+
declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
|
|
28
34
|
export type OrdinalOptions = {
|
|
29
35
|
/**
|
|
30
36
|
* - Use formal/financial numerals
|
|
31
37
|
*/
|
|
32
|
-
formal?: boolean
|
|
33
|
-
};
|
|
34
|
-
export type CurrencyOptions = {
|
|
35
|
-
/**
|
|
36
|
-
* - Use formal/financial numerals
|
|
37
|
-
*/
|
|
38
|
-
formal?: boolean | undefined;
|
|
38
|
+
formal?: boolean;
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @
|
|
43
|
-
* @param {CardinalOptions} [options] - Optional configuration
|
|
44
|
-
* @returns {string} The number in Simplified Chinese words
|
|
41
|
+
* @typedef {object} OrdinalOptions
|
|
42
|
+
* @property {boolean} [formal] - Use formal/financial numerals
|
|
45
43
|
*/
|
|
46
|
-
|
|
44
|
+
/** @type {Required<OrdinalOptions>} */
|
|
45
|
+
export declare const ordinalDefaults: Required<OrdinalOptions>;
|
|
47
46
|
/**
|
|
48
47
|
* Converts a numeric value to Simplified Chinese ordinal words.
|
|
49
48
|
* @param {number | string | bigint} value - The numeric value to convert (positive integer)
|
|
@@ -56,7 +55,19 @@ export function toCardinal(value: number | string | bigint, options?: CardinalOp
|
|
|
56
55
|
* toOrdinal(1, { formal: false }) // '第一'
|
|
57
56
|
* toOrdinal(10) // '第壹拾'
|
|
58
57
|
*/
|
|
59
|
-
|
|
58
|
+
declare function toOrdinal(value: number | string | bigint, options?: OrdinalOptions): string;
|
|
59
|
+
export type CurrencyOptions = {
|
|
60
|
+
/**
|
|
61
|
+
* - Use formal/financial numerals
|
|
62
|
+
*/
|
|
63
|
+
formal?: boolean;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* @typedef {object} CurrencyOptions
|
|
67
|
+
* @property {boolean} [formal] - Use formal/financial numerals
|
|
68
|
+
*/
|
|
69
|
+
/** @type {Required<CurrencyOptions>} */
|
|
70
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
60
71
|
/**
|
|
61
72
|
* Converts a numeric value to Simplified Chinese currency words (Yuan/Renminbi).
|
|
62
73
|
* @param {number | string | bigint} value - The currency amount to convert
|
|
@@ -70,4 +81,5 @@ export function toOrdinal(value: number | string | bigint, options?: OrdinalOpti
|
|
|
70
81
|
* toCurrency(0.05) // '伍分'
|
|
71
82
|
* toCurrency(42.50, { formal: false }) // '四十二元五角整'
|
|
72
83
|
*/
|
|
73
|
-
|
|
84
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
85
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/zh-Hant-TW.d.ts
CHANGED
|
@@ -1,49 +1,52 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* @property {boolean} [formal] - Use formal/financial numerals
|
|
2
|
+
* Traditional Chinese (Taiwan) language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: zh-Hant-TW | Traditional Chinese as used in Taiwan
|
|
5
|
+
*
|
|
6
|
+
* Key features:
|
|
7
|
+
* - Myriad-based (萬, 億) grouping - 4 digits
|
|
8
|
+
* - Formal (financial) vs common numerals
|
|
9
|
+
* - Zero insertion for skipped positions
|
|
10
|
+
* - No word separators (concatenated format)
|
|
11
|
+
*
|
|
12
|
+
* Differences from Simplified:
|
|
13
|
+
* - Different character forms (e.g., 負/负, 點/点, 億/亿, 萬/万)
|
|
14
|
+
* - Some formal numerals differ (參/叁, 貳/贰, 陸/陆)
|
|
19
15
|
*/
|
|
20
|
-
|
|
21
|
-
export const
|
|
16
|
+
export declare const cardinalMax: bigint;
|
|
17
|
+
export declare const ordinalMax: bigint;
|
|
18
|
+
export declare const currencyMax: bigint;
|
|
22
19
|
export type CardinalOptions = {
|
|
23
20
|
/**
|
|
24
21
|
* - Use formal/financial numerals
|
|
25
22
|
*/
|
|
26
|
-
formal?: boolean
|
|
23
|
+
formal?: boolean;
|
|
27
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* @typedef {object} CardinalOptions
|
|
27
|
+
* @property {boolean} [formal] - Use formal/financial numerals
|
|
28
|
+
*/
|
|
29
|
+
/** @type {Required<CardinalOptions>} */
|
|
30
|
+
export declare const cardinalDefaults: Required<CardinalOptions>;
|
|
31
|
+
/**
|
|
32
|
+
* Converts a numeric value to Traditional Chinese words.
|
|
33
|
+
* @param {number | string | bigint} value - The numeric value to convert
|
|
34
|
+
* @param {CardinalOptions} [options] - Optional configuration
|
|
35
|
+
* @returns {string} The number in Traditional Chinese words
|
|
36
|
+
*/
|
|
37
|
+
declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
|
|
28
38
|
export type OrdinalOptions = {
|
|
29
39
|
/**
|
|
30
40
|
* - Use formal/financial numerals
|
|
31
41
|
*/
|
|
32
|
-
formal?: boolean
|
|
33
|
-
};
|
|
34
|
-
export type CurrencyOptions = {
|
|
35
|
-
/**
|
|
36
|
-
* - Use formal/financial numerals
|
|
37
|
-
*/
|
|
38
|
-
formal?: boolean | undefined;
|
|
42
|
+
formal?: boolean;
|
|
39
43
|
};
|
|
40
44
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @
|
|
43
|
-
* @param {CardinalOptions} [options] - Optional configuration
|
|
44
|
-
* @returns {string} The number in Traditional Chinese words
|
|
45
|
+
* @typedef {object} OrdinalOptions
|
|
46
|
+
* @property {boolean} [formal] - Use formal/financial numerals
|
|
45
47
|
*/
|
|
46
|
-
|
|
48
|
+
/** @type {Required<OrdinalOptions>} */
|
|
49
|
+
export declare const ordinalDefaults: Required<OrdinalOptions>;
|
|
47
50
|
/**
|
|
48
51
|
* Converts a numeric value to Traditional Chinese ordinal words.
|
|
49
52
|
* @param {number | string | bigint} value - The numeric value to convert (positive integer)
|
|
@@ -56,7 +59,19 @@ export function toCardinal(value: number | string | bigint, options?: CardinalOp
|
|
|
56
59
|
* toOrdinal(2) // '第貳'
|
|
57
60
|
* toOrdinal(1, { formal: false }) // '第一'
|
|
58
61
|
*/
|
|
59
|
-
|
|
62
|
+
declare function toOrdinal(value: number | string | bigint, options?: OrdinalOptions): string;
|
|
63
|
+
export type CurrencyOptions = {
|
|
64
|
+
/**
|
|
65
|
+
* - Use formal/financial numerals
|
|
66
|
+
*/
|
|
67
|
+
formal?: boolean;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* @typedef {object} CurrencyOptions
|
|
71
|
+
* @property {boolean} [formal] - Use formal/financial numerals
|
|
72
|
+
*/
|
|
73
|
+
/** @type {Required<CurrencyOptions>} */
|
|
74
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
60
75
|
/**
|
|
61
76
|
* Converts a numeric value to Traditional Chinese currency words (New Taiwan Dollar).
|
|
62
77
|
*
|
|
@@ -72,4 +87,5 @@ export function toOrdinal(value: number | string | bigint, options?: OrdinalOpti
|
|
|
72
87
|
* toCurrency(1.50) // '壹圓伍角整'
|
|
73
88
|
* toCurrency(42, { formal: false }) // '四十二元整'
|
|
74
89
|
*/
|
|
75
|
-
|
|
90
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
91
|
+
export { toCardinal, toOrdinal, toCurrency };
|