n2words 5.1.0 → 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 +14 -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 +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 +17 -17
- 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-Cyrl-RS.js +6 -5
- package/src/sr-Latn-RS.d.ts +40 -26
- package/src/sr-Latn-RS.js +6 -5
- 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/en-CA.d.ts
CHANGED
|
@@ -1,35 +1,43 @@
|
|
|
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
|
-
*
|
|
2
|
+
* Canadian English language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: en-CA | English as used in Canada
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - toCardinal(value, options?) - Cardinal numbers: 42 → "forty-two"
|
|
8
|
+
* - toOrdinal(value) - Ordinal numbers: 42 → "forty-second"
|
|
9
|
+
* - toCurrency(value, options?) - Currency: 42.50 → "forty-two dollars and fifty cents"
|
|
10
|
+
*
|
|
11
|
+
* Canadian English conventions:
|
|
12
|
+
* - Follows British English style for number words
|
|
13
|
+
* - "and" after hundreds: "one hundred and twenty-three" (default)
|
|
14
|
+
* - "and" before final segment: "one million and one" (default)
|
|
15
|
+
* - Hyphenated tens-ones: "twenty-one", "forty-two"
|
|
16
|
+
* - Western numbering system (short scale: billion = 10^9)
|
|
17
|
+
* - Optional hundred-pairing: 1500 → "fifteen hundred" (colloquial)
|
|
18
|
+
* - Optional "and" omission: 101 → "one hundred one" (American style)
|
|
19
|
+
* - Currency: Canadian Dollar (CAD) - dollar/dollars, cent/cents
|
|
14
20
|
*/
|
|
15
|
-
|
|
16
|
-
export const
|
|
21
|
+
export declare const cardinalMax: bigint;
|
|
22
|
+
export declare const ordinalMax: bigint;
|
|
23
|
+
export declare const currencyMax: bigint;
|
|
17
24
|
export type CardinalOptions = {
|
|
18
25
|
/**
|
|
19
26
|
* - Use hundred-pairing for 1100-9999 (e.g., "fifteen hundred" instead of "one thousand five hundred")
|
|
20
27
|
*/
|
|
21
|
-
hundredPairing?: boolean
|
|
28
|
+
hundredPairing?: boolean;
|
|
22
29
|
/**
|
|
23
30
|
* - Use "and" after hundreds and before final small numbers (default: true, Canadian/British style)
|
|
24
31
|
*/
|
|
25
|
-
and?: boolean
|
|
26
|
-
};
|
|
27
|
-
export type CurrencyOptions = {
|
|
28
|
-
/**
|
|
29
|
-
* - Use "and" between dollars and cents (e.g., "one dollar and fifty cents")
|
|
30
|
-
*/
|
|
31
|
-
and?: boolean | undefined;
|
|
32
|
+
and?: boolean;
|
|
32
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* @typedef {object} CardinalOptions
|
|
36
|
+
* @property {boolean} [hundredPairing] - Use hundred-pairing for 1100-9999 (e.g., "fifteen hundred" instead of "one thousand five hundred")
|
|
37
|
+
* @property {boolean} [and] - Use "and" after hundreds and before final small numbers (default: true, Canadian/British style)
|
|
38
|
+
*/
|
|
39
|
+
/** @type {Required<CardinalOptions>} */
|
|
40
|
+
export declare const cardinalDefaults: Required<CardinalOptions>;
|
|
33
41
|
/**
|
|
34
42
|
* Converts a numeric value to Canadian English words.
|
|
35
43
|
*
|
|
@@ -47,7 +55,7 @@ export type CurrencyOptions = {
|
|
|
47
55
|
* toCardinal(1500) // 'one thousand five hundred'
|
|
48
56
|
* toCardinal(1500, { hundredPairing: true }) // 'fifteen hundred'
|
|
49
57
|
*/
|
|
50
|
-
|
|
58
|
+
declare function toCardinal(value: number | string | bigint, options?: CardinalOptions): string;
|
|
51
59
|
/**
|
|
52
60
|
* Converts a numeric value to Canadian English ordinal words.
|
|
53
61
|
* @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
|
|
@@ -64,7 +72,19 @@ export function toCardinal(value: number | string | bigint, options?: CardinalOp
|
|
|
64
72
|
* toOrdinal(101) // 'one hundred first'
|
|
65
73
|
* toOrdinal(1000) // 'one thousandth'
|
|
66
74
|
*/
|
|
67
|
-
|
|
75
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
76
|
+
export type CurrencyOptions = {
|
|
77
|
+
/**
|
|
78
|
+
* - Use "and" between dollars and cents (e.g., "one dollar and fifty cents")
|
|
79
|
+
*/
|
|
80
|
+
and?: boolean;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* @typedef {object} CurrencyOptions
|
|
84
|
+
* @property {boolean} [and] - Use "and" between dollars and cents (e.g., "one dollar and fifty cents")
|
|
85
|
+
*/
|
|
86
|
+
/** @type {Required<CurrencyOptions>} */
|
|
87
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
68
88
|
/**
|
|
69
89
|
* Converts a numeric value to Canadian English currency words.
|
|
70
90
|
* @param {number | string | bigint} value - The currency amount to convert
|
|
@@ -78,4 +98,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
78
98
|
* toCurrency(0.99) // 'ninety-nine cents'
|
|
79
99
|
* toCurrency(42.50, { and: false }) // 'forty-two dollars fifty cents'
|
|
80
100
|
*/
|
|
81
|
-
|
|
101
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
102
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/en-GB.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* British English language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: en-GB | English as used in the United Kingdom
|
|
5
|
+
*
|
|
6
|
+
* British English conventions:
|
|
7
|
+
* - "and" after hundreds: "one hundred and twenty-three"
|
|
8
|
+
* - "and" before final segment: "one million and one"
|
|
9
|
+
* - Hyphenated tens-ones: "twenty-one", "forty-two"
|
|
10
|
+
* - Western numbering system (short scale: billion = 10^9)
|
|
7
11
|
*/
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* - Use "and" between pounds and pence (e.g., "one pound and fifty pence")
|
|
13
|
-
*/
|
|
14
|
-
and?: boolean | undefined;
|
|
15
|
-
};
|
|
12
|
+
export declare const cardinalMax: bigint;
|
|
13
|
+
export declare const ordinalMax: bigint;
|
|
14
|
+
export declare const currencyMax: bigint;
|
|
16
15
|
/**
|
|
17
16
|
* Converts a numeric value to English words.
|
|
18
17
|
*
|
|
@@ -27,7 +26,7 @@ export type CurrencyOptions = {
|
|
|
27
26
|
* toCardinal(-3.14) // 'minus three point fourteen'
|
|
28
27
|
* toCardinal('1000000') // 'one million'
|
|
29
28
|
*/
|
|
30
|
-
|
|
29
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
31
30
|
/**
|
|
32
31
|
* Converts a numeric value to British English ordinal words.
|
|
33
32
|
* @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
|
|
@@ -44,7 +43,19 @@ export function toCardinal(value: number | string | bigint): string;
|
|
|
44
43
|
* toOrdinal(101) // 'one hundred first'
|
|
45
44
|
* toOrdinal(1000) // 'one thousandth'
|
|
46
45
|
*/
|
|
47
|
-
|
|
46
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
47
|
+
export type CurrencyOptions = {
|
|
48
|
+
/**
|
|
49
|
+
* - Use "and" between pounds and pence (e.g., "one pound and fifty pence")
|
|
50
|
+
*/
|
|
51
|
+
and?: boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @typedef {object} CurrencyOptions
|
|
55
|
+
* @property {boolean} [and] - Use "and" between pounds and pence (e.g., "one pound and fifty pence")
|
|
56
|
+
*/
|
|
57
|
+
/** @type {Required<CurrencyOptions>} */
|
|
58
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
48
59
|
/**
|
|
49
60
|
* Converts a numeric value to British English currency words.
|
|
50
61
|
* @param {number | string | bigint} value - The currency amount to convert
|
|
@@ -59,4 +70,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
59
70
|
* toCurrency(0.01) // 'one penny'
|
|
60
71
|
* toCurrency(42.50, { and: false }) // 'forty-two pounds fifty pence'
|
|
61
72
|
*/
|
|
62
|
-
|
|
73
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
74
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/en-GH.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Ghanaian English language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: en-GH | English as used in Ghana
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - toCardinal(value) - Cardinal numbers: 42 → "forty-two"
|
|
8
|
+
* - toOrdinal(value) - Ordinal numbers: 42 → "forty-second"
|
|
9
|
+
* - toCurrency(value, options?) - Currency: 42.50 → "forty-two cedis and fifty pesewas"
|
|
10
|
+
*
|
|
11
|
+
* Ghanaian English conventions:
|
|
12
|
+
* - Follows British English style
|
|
13
|
+
* - "and" after hundreds: "one hundred and twenty-three"
|
|
14
|
+
* - "and" before final segment: "one million and one"
|
|
15
|
+
* - Hyphenated tens-ones: "twenty-one", "forty-two"
|
|
16
|
+
* - Western numbering system (short scale: billion = 10^9)
|
|
17
|
+
* - Currency: Ghanaian Cedi (GHS) - cedi/cedis, pesewa/pesewas
|
|
7
18
|
*/
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* - Use "and" between cedis and pesewas
|
|
13
|
-
*/
|
|
14
|
-
and?: boolean | undefined;
|
|
15
|
-
};
|
|
19
|
+
export declare const cardinalMax: bigint;
|
|
20
|
+
export declare const ordinalMax: bigint;
|
|
21
|
+
export declare const currencyMax: bigint;
|
|
16
22
|
/**
|
|
17
23
|
* Converts a numeric value to Ghanaian English words.
|
|
18
24
|
* @param {number | string | bigint} value - The numeric value to convert
|
|
@@ -20,7 +26,7 @@ export type CurrencyOptions = {
|
|
|
20
26
|
* @throws {TypeError} If value is not a valid numeric type
|
|
21
27
|
* @throws {Error} If value is not a valid number format
|
|
22
28
|
*/
|
|
23
|
-
|
|
29
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
24
30
|
/**
|
|
25
31
|
* Converts a numeric value to Ghanaian English ordinal words.
|
|
26
32
|
* @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
|
|
@@ -28,7 +34,19 @@ export function toCardinal(value: number | string | bigint): string;
|
|
|
28
34
|
* @throws {TypeError} If value is not a valid numeric type
|
|
29
35
|
* @throws {RangeError} If value is negative, zero, or has a decimal part
|
|
30
36
|
*/
|
|
31
|
-
|
|
37
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
38
|
+
export type CurrencyOptions = {
|
|
39
|
+
/**
|
|
40
|
+
* - Use "and" between cedis and pesewas
|
|
41
|
+
*/
|
|
42
|
+
and?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {object} CurrencyOptions
|
|
46
|
+
* @property {boolean} [and] - Use "and" between cedis and pesewas
|
|
47
|
+
*/
|
|
48
|
+
/** @type {Required<CurrencyOptions>} */
|
|
49
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
32
50
|
/**
|
|
33
51
|
* Converts a numeric value to Ghanaian English currency words.
|
|
34
52
|
* @param {number | string | bigint} value - The currency amount to convert
|
|
@@ -37,4 +55,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
37
55
|
* @throws {TypeError} If value is not a valid numeric type
|
|
38
56
|
* @throws {Error} If value is not a valid number format
|
|
39
57
|
*/
|
|
40
|
-
|
|
58
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
59
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/en-IE.d.ts
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Irish English language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: en-IE | English as used in Ireland
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - toCardinal(value) - Cardinal numbers: 42 → "forty-two"
|
|
8
|
+
* - toOrdinal(value) - Ordinal numbers: 42 → "forty-second"
|
|
9
|
+
* - toCurrency(value, options?) - Currency: 42.50 → "forty-two euro and fifty cent"
|
|
10
|
+
*
|
|
11
|
+
* Irish English conventions:
|
|
12
|
+
* - Follows British English style
|
|
13
|
+
* - "and" after hundreds: "one hundred and twenty-three"
|
|
14
|
+
* - "and" before final segment: "one million and one"
|
|
15
|
+
* - Hyphenated tens-ones: "twenty-one", "forty-two"
|
|
16
|
+
* - Western numbering system (short scale: billion = 10^9)
|
|
17
|
+
* - Currency: Euro (EUR) - euro (singular/plural), cent/cents
|
|
18
|
+
*
|
|
19
|
+
* Note: In Irish English, "euro" is typically invariable (same for singular and plural),
|
|
20
|
+
* though "euros" is also accepted. This implementation uses "euro" for both.
|
|
7
21
|
*/
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* - Use "and" between euro and cent (e.g., "one euro and fifty cents")
|
|
13
|
-
*/
|
|
14
|
-
and?: boolean | undefined;
|
|
15
|
-
};
|
|
22
|
+
export declare const cardinalMax: bigint;
|
|
23
|
+
export declare const ordinalMax: bigint;
|
|
24
|
+
export declare const currencyMax: bigint;
|
|
16
25
|
/**
|
|
17
26
|
* Converts a numeric value to Irish English words.
|
|
18
27
|
*
|
|
@@ -27,7 +36,7 @@ export type CurrencyOptions = {
|
|
|
27
36
|
* toCardinal(-3.14) // 'minus three point fourteen'
|
|
28
37
|
* toCardinal('1000000') // 'one million'
|
|
29
38
|
*/
|
|
30
|
-
|
|
39
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
31
40
|
/**
|
|
32
41
|
* Converts a numeric value to Irish English ordinal words.
|
|
33
42
|
* @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
|
|
@@ -44,7 +53,19 @@ export function toCardinal(value: number | string | bigint): string;
|
|
|
44
53
|
* toOrdinal(101) // 'one hundred first'
|
|
45
54
|
* toOrdinal(1000) // 'one thousandth'
|
|
46
55
|
*/
|
|
47
|
-
|
|
56
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
57
|
+
export type CurrencyOptions = {
|
|
58
|
+
/**
|
|
59
|
+
* - Use "and" between euro and cent (e.g., "one euro and fifty cents")
|
|
60
|
+
*/
|
|
61
|
+
and?: boolean;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* @typedef {object} CurrencyOptions
|
|
65
|
+
* @property {boolean} [and] - Use "and" between euro and cent (e.g., "one euro and fifty cents")
|
|
66
|
+
*/
|
|
67
|
+
/** @type {Required<CurrencyOptions>} */
|
|
68
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
48
69
|
/**
|
|
49
70
|
* Converts a numeric value to Irish English currency words.
|
|
50
71
|
* @param {number | string | bigint} value - The currency amount to convert
|
|
@@ -59,4 +80,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
59
80
|
* toCurrency(0.01) // 'one cent'
|
|
60
81
|
* toCurrency(42.50, { and: false }) // 'forty-two euro fifty cents'
|
|
61
82
|
*/
|
|
62
|
-
|
|
83
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
84
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/en-IN.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* English (India) language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: en-IN | English as used in India
|
|
5
|
+
*
|
|
6
|
+
* Key features:
|
|
7
|
+
* - Indian numbering system (thousand, lakh, crore, arab, kharab)
|
|
8
|
+
* - 3-2-2 grouping pattern (last 3 digits, then groups of 2)
|
|
9
|
+
* - British-style "and" after hundreds
|
|
10
|
+
* - Indian Rupee currency (INR)
|
|
7
11
|
*/
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* - Use "and" between rupees and paise
|
|
13
|
-
*/
|
|
14
|
-
and?: boolean | undefined;
|
|
15
|
-
};
|
|
12
|
+
export declare const cardinalMax: bigint;
|
|
13
|
+
export declare const ordinalMax: bigint;
|
|
14
|
+
export declare const currencyMax: bigint;
|
|
16
15
|
/**
|
|
17
16
|
* Converts a numeric value to English words using Indian numbering.
|
|
18
17
|
* @param {number | string | bigint} value - The numeric value to convert
|
|
@@ -25,7 +24,7 @@ export type CurrencyOptions = {
|
|
|
25
24
|
* toCardinal(10000000) // 'one crore'
|
|
26
25
|
* toCardinal(1234567) // 'twelve lakh thirty-four thousand five hundred and sixty-seven'
|
|
27
26
|
*/
|
|
28
|
-
|
|
27
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
29
28
|
/**
|
|
30
29
|
* Converts a numeric value to English ordinal words using Indian numbering.
|
|
31
30
|
* @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
|
|
@@ -37,7 +36,19 @@ export function toCardinal(value: number | string | bigint): string;
|
|
|
37
36
|
* toOrdinal(100000) // 'one lakhth'
|
|
38
37
|
* toOrdinal(100001) // 'one lakh first'
|
|
39
38
|
*/
|
|
40
|
-
|
|
39
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
40
|
+
export type CurrencyOptions = {
|
|
41
|
+
/**
|
|
42
|
+
* - Use "and" between rupees and paise
|
|
43
|
+
*/
|
|
44
|
+
and?: boolean;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {object} CurrencyOptions
|
|
48
|
+
* @property {boolean} [and] - Use "and" between rupees and paise
|
|
49
|
+
*/
|
|
50
|
+
/** @type {Required<CurrencyOptions>} */
|
|
51
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
41
52
|
/**
|
|
42
53
|
* Converts a numeric value to Indian English currency words.
|
|
43
54
|
* @param {number | string | bigint} value - The currency amount to convert
|
|
@@ -52,4 +63,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
52
63
|
* toCurrency(0.50) // 'fifty paise'
|
|
53
64
|
* toCurrency(42.50, { and: false }) // 'forty-two rupees fifty paise'
|
|
54
65
|
*/
|
|
55
|
-
|
|
66
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
67
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/en-KE.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Kenyan English language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: en-KE | English as used in Kenya
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - toCardinal(value) - Cardinal numbers: 42 → "forty-two"
|
|
8
|
+
* - toOrdinal(value) - Ordinal numbers: 42 → "forty-second"
|
|
9
|
+
* - toCurrency(value, options?) - Currency: 42.50 → "forty-two shillings and fifty cents"
|
|
10
|
+
*
|
|
11
|
+
* Kenyan English conventions:
|
|
12
|
+
* - Follows British English style
|
|
13
|
+
* - "and" after hundreds: "one hundred and twenty-three"
|
|
14
|
+
* - "and" before final segment: "one million and one"
|
|
15
|
+
* - Hyphenated tens-ones: "twenty-one", "forty-two"
|
|
16
|
+
* - Western numbering system (short scale: billion = 10^9)
|
|
17
|
+
* - Currency: Kenyan Shilling (KES) - shilling/shillings, cent/cents
|
|
7
18
|
*/
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* - Use "and" between shillings and cents
|
|
13
|
-
*/
|
|
14
|
-
and?: boolean | undefined;
|
|
15
|
-
};
|
|
19
|
+
export declare const cardinalMax: bigint;
|
|
20
|
+
export declare const ordinalMax: bigint;
|
|
21
|
+
export declare const currencyMax: bigint;
|
|
16
22
|
/**
|
|
17
23
|
* Converts a numeric value to Kenyan English words.
|
|
18
24
|
* @param {number | string | bigint} value - The numeric value to convert
|
|
@@ -20,17 +26,30 @@ export type CurrencyOptions = {
|
|
|
20
26
|
* @throws {TypeError} If value is not a valid numeric type
|
|
21
27
|
* @throws {Error} If value is not a valid number format
|
|
22
28
|
*/
|
|
23
|
-
|
|
29
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
24
30
|
/**
|
|
25
31
|
* Converts a numeric value to Kenyan English ordinal words.
|
|
26
32
|
* @param {number | string | bigint} value - The numeric value to convert
|
|
27
33
|
* @returns {string} The ordinal in English words
|
|
28
34
|
*/
|
|
29
|
-
|
|
35
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
36
|
+
export type CurrencyOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* - Use "and" between shillings and cents
|
|
39
|
+
*/
|
|
40
|
+
and?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* @typedef {object} CurrencyOptions
|
|
44
|
+
* @property {boolean} [and] - Use "and" between shillings and cents
|
|
45
|
+
*/
|
|
46
|
+
/** @type {Required<CurrencyOptions>} */
|
|
47
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
30
48
|
/**
|
|
31
49
|
* Converts a numeric value to Kenyan English currency words.
|
|
32
50
|
* @param {number | string | bigint} value - The numeric value to convert
|
|
33
51
|
* @param {CurrencyOptions} [options] - Optional configuration
|
|
34
52
|
* @returns {string} The currency in English words
|
|
35
53
|
*/
|
|
36
|
-
|
|
54
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
55
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/en-MY.d.ts
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Malaysian English language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: en-MY | English as used in Malaysia
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - toCardinal(value) - Cardinal numbers: 42 → "forty-two"
|
|
8
|
+
* - toOrdinal(value) - Ordinal numbers: 42 → "forty-second"
|
|
9
|
+
* - toCurrency(value, options?) - Currency: 42.50 → "forty-two ringgit and fifty sen"
|
|
10
|
+
*
|
|
11
|
+
* Malaysian English conventions:
|
|
12
|
+
* - Follows British English style
|
|
13
|
+
* - "and" after hundreds: "one hundred and twenty-three"
|
|
14
|
+
* - "and" before final segment: "one million and one"
|
|
15
|
+
* - Hyphenated tens-ones: "twenty-one", "forty-two"
|
|
16
|
+
* - Western numbering system (short scale: billion = 10^9)
|
|
17
|
+
* - Currency: Malaysian Ringgit (MYR) - ringgit (invariable), sen (invariable)
|
|
18
|
+
*
|
|
19
|
+
* Note: Both "ringgit" and "sen" are typically invariable (same for singular and plural)
|
|
20
|
+
* in Malaysian English.
|
|
7
21
|
*/
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* - Use "and" between ringgit and sen
|
|
13
|
-
*/
|
|
14
|
-
and?: boolean | undefined;
|
|
15
|
-
};
|
|
22
|
+
export declare const cardinalMax: bigint;
|
|
23
|
+
export declare const ordinalMax: bigint;
|
|
24
|
+
export declare const currencyMax: bigint;
|
|
16
25
|
/**
|
|
17
26
|
* Converts a numeric value to Malaysian English words.
|
|
18
27
|
* @param {number | string | bigint} value - The numeric value to convert
|
|
@@ -20,15 +29,28 @@ export type CurrencyOptions = {
|
|
|
20
29
|
* @throws {TypeError} If value is not a valid numeric type
|
|
21
30
|
* @throws {Error} If value is not a valid number format
|
|
22
31
|
*/
|
|
23
|
-
|
|
32
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
24
33
|
/**
|
|
25
34
|
* @param {number | string | bigint} value The numeric value to convert.
|
|
26
35
|
* @returns {string} The number as an ordinal in English words.
|
|
27
36
|
*/
|
|
28
|
-
|
|
37
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
38
|
+
export type CurrencyOptions = {
|
|
39
|
+
/**
|
|
40
|
+
* - Use "and" between ringgit and sen
|
|
41
|
+
*/
|
|
42
|
+
and?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @typedef {object} CurrencyOptions
|
|
46
|
+
* @property {boolean} [and] - Use "and" between ringgit and sen
|
|
47
|
+
*/
|
|
48
|
+
/** @type {Required<CurrencyOptions>} */
|
|
49
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
29
50
|
/**
|
|
30
51
|
* @param {number | string | bigint} value The numeric value to convert.
|
|
31
52
|
* @param {CurrencyOptions} [options] - Optional configuration
|
|
32
53
|
* @returns {string} The amount in Malaysian ringgit and sen in English words.
|
|
33
54
|
*/
|
|
34
|
-
|
|
55
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
56
|
+
export { toCardinal, toOrdinal, toCurrency };
|
package/src/en-NG.d.ts
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
export const cardinalMax: bigint;
|
|
2
|
-
export const ordinalMax: bigint;
|
|
3
|
-
export const currencyMax: bigint;
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Nigerian English language converter
|
|
3
|
+
*
|
|
4
|
+
* CLDR: en-NG | English as used in Nigeria
|
|
5
|
+
*
|
|
6
|
+
* Exports:
|
|
7
|
+
* - toCardinal(value) - Cardinal numbers: 42 → "forty-two"
|
|
8
|
+
* - toOrdinal(value) - Ordinal numbers: 42 → "forty-second"
|
|
9
|
+
* - toCurrency(value, options?) - Currency: 42.50 → "forty-two naira and fifty kobo"
|
|
10
|
+
*
|
|
11
|
+
* Nigerian English conventions:
|
|
12
|
+
* - Follows British English style
|
|
13
|
+
* - "and" after hundreds: "one hundred and twenty-three"
|
|
14
|
+
* - "and" before final segment: "one million and one"
|
|
15
|
+
* - Hyphenated tens-ones: "twenty-one", "forty-two"
|
|
16
|
+
* - Western numbering system (short scale: billion = 10^9)
|
|
17
|
+
* - Currency: Nigerian Naira (NGN) - naira (singular/plural), kobo (singular/plural)
|
|
18
|
+
*
|
|
19
|
+
* Note: In Nigerian English, both "naira" and "kobo" are typically invariable
|
|
20
|
+
* (same for singular and plural).
|
|
7
21
|
*/
|
|
8
|
-
|
|
9
|
-
export const
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* - Use "and" between naira and kobo (e.g., "one naira and fifty kobo")
|
|
13
|
-
*/
|
|
14
|
-
and?: boolean | undefined;
|
|
15
|
-
};
|
|
22
|
+
export declare const cardinalMax: bigint;
|
|
23
|
+
export declare const ordinalMax: bigint;
|
|
24
|
+
export declare const currencyMax: bigint;
|
|
16
25
|
/**
|
|
17
26
|
* Converts a numeric value to Nigerian English words.
|
|
18
27
|
*
|
|
@@ -27,7 +36,7 @@ export type CurrencyOptions = {
|
|
|
27
36
|
* toCardinal(-3.14) // 'minus three point fourteen'
|
|
28
37
|
* toCardinal('1000000') // 'one million'
|
|
29
38
|
*/
|
|
30
|
-
|
|
39
|
+
declare function toCardinal(value: number | string | bigint): string;
|
|
31
40
|
/**
|
|
32
41
|
* Converts a numeric value to Nigerian English ordinal words.
|
|
33
42
|
* @param {number | string | bigint} value - The numeric value to convert (must be a positive integer)
|
|
@@ -44,7 +53,19 @@ export function toCardinal(value: number | string | bigint): string;
|
|
|
44
53
|
* toOrdinal(101) // 'one hundred first'
|
|
45
54
|
* toOrdinal(1000) // 'one thousandth'
|
|
46
55
|
*/
|
|
47
|
-
|
|
56
|
+
declare function toOrdinal(value: number | string | bigint): string;
|
|
57
|
+
export type CurrencyOptions = {
|
|
58
|
+
/**
|
|
59
|
+
* - Use "and" between naira and kobo (e.g., "one naira and fifty kobo")
|
|
60
|
+
*/
|
|
61
|
+
and?: boolean;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* @typedef {object} CurrencyOptions
|
|
65
|
+
* @property {boolean} [and] - Use "and" between naira and kobo (e.g., "one naira and fifty kobo")
|
|
66
|
+
*/
|
|
67
|
+
/** @type {Required<CurrencyOptions>} */
|
|
68
|
+
export declare const currencyDefaults: Required<CurrencyOptions>;
|
|
48
69
|
/**
|
|
49
70
|
* Converts a numeric value to Nigerian English currency words.
|
|
50
71
|
* @param {number | string | bigint} value - The currency amount to convert
|
|
@@ -59,4 +80,5 @@ export function toOrdinal(value: number | string | bigint): string;
|
|
|
59
80
|
* toCurrency(0.01) // 'one kobo'
|
|
60
81
|
* toCurrency(42.50, { and: false }) // 'forty-two naira fifty kobo'
|
|
61
82
|
*/
|
|
62
|
-
|
|
83
|
+
declare function toCurrency(value: number | string | bigint, options?: CurrencyOptions): string;
|
|
84
|
+
export { toCardinal, toOrdinal, toCurrency };
|