n2words 1.23.1 → 2.0.0
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/LICENSE +1 -1
- package/README.md +317 -59
- package/dist/ArabicConverter.js +3 -0
- package/dist/ArabicConverter.js.map +1 -0
- package/dist/AzerbaijaniConverter.js +3 -0
- package/dist/AzerbaijaniConverter.js.map +1 -0
- package/dist/BanglaConverter.js +3 -0
- package/dist/BanglaConverter.js.map +1 -0
- package/dist/BiblicalHebrewConverter.js +3 -0
- package/dist/BiblicalHebrewConverter.js.map +1 -0
- package/dist/CroatianConverter.js +3 -0
- package/dist/CroatianConverter.js.map +1 -0
- package/dist/CzechConverter.js +3 -0
- package/dist/CzechConverter.js.map +1 -0
- package/dist/DanishConverter.js +3 -0
- package/dist/DanishConverter.js.map +1 -0
- package/dist/DutchConverter.js +3 -0
- package/dist/DutchConverter.js.map +1 -0
- package/dist/EnglishConverter.js +3 -0
- package/dist/EnglishConverter.js.map +1 -0
- package/dist/FilipinoConverter.js +3 -0
- package/dist/FilipinoConverter.js.map +1 -0
- package/dist/FrenchBelgiumConverter.js +3 -0
- package/dist/FrenchBelgiumConverter.js.map +1 -0
- package/dist/FrenchConverter.js +3 -0
- package/dist/FrenchConverter.js.map +1 -0
- package/dist/GermanConverter.js +3 -0
- package/dist/GermanConverter.js.map +1 -0
- package/dist/GreekConverter.js +3 -0
- package/dist/GreekConverter.js.map +1 -0
- package/dist/GujaratiConverter.js +3 -0
- package/dist/GujaratiConverter.js.map +1 -0
- package/dist/HebrewConverter.js +3 -0
- package/dist/HebrewConverter.js.map +1 -0
- package/dist/HindiConverter.js +3 -0
- package/dist/HindiConverter.js.map +1 -0
- package/dist/HungarianConverter.js +3 -0
- package/dist/HungarianConverter.js.map +1 -0
- package/dist/IndonesianConverter.js +3 -0
- package/dist/IndonesianConverter.js.map +1 -0
- package/dist/ItalianConverter.js +3 -0
- package/dist/ItalianConverter.js.map +1 -0
- package/dist/JapaneseConverter.js +3 -0
- package/dist/JapaneseConverter.js.map +1 -0
- package/dist/KannadaConverter.js +3 -0
- package/dist/KannadaConverter.js.map +1 -0
- package/dist/KoreanConverter.js +3 -0
- package/dist/KoreanConverter.js.map +1 -0
- package/dist/LatvianConverter.js +3 -0
- package/dist/LatvianConverter.js.map +1 -0
- package/dist/LithuanianConverter.js +3 -0
- package/dist/LithuanianConverter.js.map +1 -0
- package/dist/MalayConverter.js +3 -0
- package/dist/MalayConverter.js.map +1 -0
- package/dist/MarathiConverter.js +3 -0
- package/dist/MarathiConverter.js.map +1 -0
- package/dist/NorwegianBokmalConverter.js +3 -0
- package/dist/NorwegianBokmalConverter.js.map +1 -0
- package/dist/PersianConverter.js +3 -0
- package/dist/PersianConverter.js.map +1 -0
- package/dist/PolishConverter.js +3 -0
- package/dist/PolishConverter.js.map +1 -0
- package/dist/PortugueseConverter.js +3 -0
- package/dist/PortugueseConverter.js.map +1 -0
- package/dist/PunjabiConverter.js +3 -0
- package/dist/PunjabiConverter.js.map +1 -0
- package/dist/RomanianConverter.js +3 -0
- package/dist/RomanianConverter.js.map +1 -0
- package/dist/RussianConverter.js +3 -0
- package/dist/RussianConverter.js.map +1 -0
- package/dist/SerbianCyrillicConverter.js +3 -0
- package/dist/SerbianCyrillicConverter.js.map +1 -0
- package/dist/SerbianLatinConverter.js +3 -0
- package/dist/SerbianLatinConverter.js.map +1 -0
- package/dist/SimplifiedChineseConverter.js +3 -0
- package/dist/SimplifiedChineseConverter.js.map +1 -0
- package/dist/SpanishConverter.js +3 -0
- package/dist/SpanishConverter.js.map +1 -0
- package/dist/SwahiliConverter.js +3 -0
- package/dist/SwahiliConverter.js.map +1 -0
- package/dist/SwedishConverter.js +3 -0
- package/dist/SwedishConverter.js.map +1 -0
- package/dist/TamilConverter.js +3 -0
- package/dist/TamilConverter.js.map +1 -0
- package/dist/TeluguConverter.js +3 -0
- package/dist/TeluguConverter.js.map +1 -0
- package/dist/ThaiConverter.js +3 -0
- package/dist/ThaiConverter.js.map +1 -0
- package/dist/TraditionalChineseConverter.js +3 -0
- package/dist/TraditionalChineseConverter.js.map +1 -0
- package/dist/TurkishConverter.js +3 -0
- package/dist/TurkishConverter.js.map +1 -0
- package/dist/UkrainianConverter.js +3 -0
- package/dist/UkrainianConverter.js.map +1 -0
- package/dist/UrduConverter.js +3 -0
- package/dist/UrduConverter.js.map +1 -0
- package/dist/VietnameseConverter.js +3 -0
- package/dist/VietnameseConverter.js.map +1 -0
- package/dist/n2words.js +3 -2
- package/dist/n2words.js.map +1 -1
- package/lib/classes/abstract-language.d.ts +158 -34
- package/lib/classes/abstract-language.js +223 -115
- package/lib/classes/greedy-scale-language.d.ts +109 -0
- package/lib/classes/greedy-scale-language.js +201 -0
- package/lib/classes/slavic-language.d.ts +148 -0
- package/lib/classes/slavic-language.js +281 -0
- package/lib/classes/south-asian-language.d.ts +70 -0
- package/lib/classes/south-asian-language.js +154 -0
- package/lib/classes/turkic-language.d.ts +26 -0
- package/lib/classes/turkic-language.js +59 -0
- package/lib/languages/ar.d.ts +30 -0
- package/lib/languages/ar.js +159 -0
- package/lib/languages/az.d.ts +12 -0
- package/lib/languages/az.js +42 -0
- package/lib/languages/bn.d.ts +11 -0
- package/lib/languages/bn.js +131 -0
- package/lib/languages/cs.d.ts +88 -0
- package/lib/languages/cs.js +143 -0
- package/lib/languages/da.d.ts +15 -0
- package/lib/languages/da.js +120 -0
- package/lib/languages/de.d.ts +14 -0
- package/lib/languages/de.js +101 -0
- package/lib/languages/el.d.ts +14 -0
- package/lib/languages/el.js +90 -0
- package/lib/languages/en.d.ts +16 -0
- package/lib/languages/en.js +86 -0
- package/lib/languages/es.d.ts +15 -0
- package/lib/languages/es.js +121 -0
- package/lib/languages/fa.d.ts +47 -0
- package/lib/languages/fa.js +144 -0
- package/lib/languages/fil.d.ts +16 -0
- package/lib/languages/fil.js +121 -0
- package/lib/languages/fr-BE.d.ts +11 -0
- package/lib/languages/fr-BE.js +25 -0
- package/lib/languages/fr.d.ts +15 -0
- package/lib/languages/fr.js +106 -0
- package/lib/languages/gu.d.ts +11 -0
- package/lib/languages/gu.js +132 -0
- package/lib/languages/hbo.d.ts +113 -0
- package/lib/languages/hbo.js +251 -0
- package/lib/languages/he.d.ts +80 -0
- package/lib/languages/he.js +206 -0
- package/lib/languages/hi.d.ts +11 -0
- package/lib/languages/hi.js +131 -0
- package/lib/languages/hr.d.ts +80 -0
- package/lib/languages/hr.js +113 -0
- package/lib/languages/hu.d.ts +22 -0
- package/lib/languages/hu.js +137 -0
- package/lib/languages/id.d.ts +37 -0
- package/lib/languages/id.js +159 -0
- package/lib/languages/it.d.ts +37 -0
- package/lib/languages/it.js +132 -0
- package/lib/languages/ja.d.ts +17 -0
- package/lib/languages/ja.js +137 -0
- package/lib/languages/kn.d.ts +11 -0
- package/lib/languages/kn.js +42 -0
- package/lib/languages/ko.d.ts +14 -0
- package/lib/languages/ko.js +55 -0
- package/lib/{i18n/pl.d.ts → languages/lt.d.ts} +18 -15
- package/lib/languages/lt.js +136 -0
- package/lib/{i18n/lt.d.ts → languages/lv.d.ts} +16 -14
- package/lib/languages/lv.js +130 -0
- package/lib/languages/mr.d.ts +11 -0
- package/lib/languages/mr.js +132 -0
- package/lib/languages/ms.d.ts +31 -0
- package/lib/languages/ms.js +150 -0
- package/lib/languages/nb.d.ts +12 -0
- package/lib/languages/nb.js +100 -0
- package/lib/languages/nl.d.ts +16 -0
- package/lib/languages/nl.js +155 -0
- package/lib/languages/pa.d.ts +11 -0
- package/lib/languages/pa.js +131 -0
- package/lib/{i18n/uk.d.ts → languages/pl.d.ts} +16 -14
- package/lib/languages/pl.js +110 -0
- package/lib/languages/pt.d.ts +29 -0
- package/lib/languages/pt.js +112 -0
- package/lib/languages/ro.d.ts +158 -0
- package/lib/languages/ro.js +273 -0
- package/lib/languages/ru.d.ts +85 -0
- package/lib/languages/ru.js +96 -0
- package/lib/languages/sr-Cyrl.d.ts +80 -0
- package/lib/languages/sr-Cyrl.js +113 -0
- package/lib/{i18n/cz.d.ts → languages/sr-Latn.d.ts} +26 -14
- package/lib/languages/sr-Latn.js +113 -0
- package/lib/languages/sv.d.ts +14 -0
- package/lib/languages/sv.js +90 -0
- package/lib/languages/sw.d.ts +39 -0
- package/lib/languages/sw.js +126 -0
- package/lib/languages/ta.d.ts +20 -0
- package/lib/languages/ta.js +226 -0
- package/lib/languages/te.d.ts +22 -0
- package/lib/languages/te.js +219 -0
- package/lib/languages/th.d.ts +17 -0
- package/lib/languages/th.js +117 -0
- package/lib/languages/tr.d.ts +12 -0
- package/lib/languages/tr.js +56 -0
- package/lib/languages/uk.d.ts +85 -0
- package/lib/{i18n → languages}/uk.js +33 -32
- package/lib/languages/ur.d.ts +11 -0
- package/lib/languages/ur.js +131 -0
- package/lib/{i18n → languages}/vi.d.ts +15 -13
- package/lib/languages/vi.js +147 -0
- package/lib/languages/zh-Hans.d.ts +21 -0
- package/lib/languages/zh-Hans.js +111 -0
- package/lib/languages/zh-Hant.d.ts +21 -0
- package/lib/languages/zh-Hant.js +111 -0
- package/lib/n2words.d.ts +207 -7
- package/lib/n2words.js +535 -81
- package/package.json +126 -79
- package/dist/ar.js +0 -2
- package/dist/ar.js.map +0 -1
- package/dist/az.js +0 -2
- package/dist/az.js.map +0 -1
- package/dist/cz.js +0 -2
- package/dist/cz.js.map +0 -1
- package/dist/de.js +0 -2
- package/dist/de.js.map +0 -1
- package/dist/dk.js +0 -2
- package/dist/dk.js.map +0 -1
- package/dist/en.js +0 -2
- package/dist/en.js.map +0 -1
- package/dist/es.js +0 -2
- package/dist/es.js.map +0 -1
- package/dist/fa.js +0 -2
- package/dist/fa.js.map +0 -1
- package/dist/fr-BE.js +0 -2
- package/dist/fr-BE.js.map +0 -1
- package/dist/fr.js +0 -2
- package/dist/fr.js.map +0 -1
- package/dist/he.js +0 -2
- package/dist/he.js.map +0 -1
- package/dist/hr.js +0 -2
- package/dist/hr.js.map +0 -1
- package/dist/hu.js +0 -2
- package/dist/hu.js.map +0 -1
- package/dist/id.js +0 -2
- package/dist/id.js.map +0 -1
- package/dist/it.js +0 -2
- package/dist/it.js.map +0 -1
- package/dist/ko.js +0 -2
- package/dist/ko.js.map +0 -1
- package/dist/lt.js +0 -2
- package/dist/lt.js.map +0 -1
- package/dist/lv.js +0 -2
- package/dist/lv.js.map +0 -1
- package/dist/n2words.d.ts +0 -2
- package/dist/nl.js +0 -2
- package/dist/nl.js.map +0 -1
- package/dist/no.js +0 -2
- package/dist/no.js.map +0 -1
- package/dist/pl.js +0 -2
- package/dist/pl.js.map +0 -1
- package/dist/pt.js +0 -2
- package/dist/pt.js.map +0 -1
- package/dist/ro.js +0 -2
- package/dist/ro.js.map +0 -1
- package/dist/ru.js +0 -2
- package/dist/ru.js.map +0 -1
- package/dist/sr.js +0 -2
- package/dist/sr.js.map +0 -1
- package/dist/tr.js +0 -2
- package/dist/tr.js.map +0 -1
- package/dist/uk.js +0 -2
- package/dist/uk.js.map +0 -1
- package/dist/vi.js +0 -2
- package/dist/vi.js.map +0 -1
- package/dist/zh.js +0 -2
- package/dist/zh.js.map +0 -1
- package/lib/classes/base-language.d.ts +0 -58
- package/lib/classes/base-language.js +0 -172
- package/lib/i18n/ar.d.ts +0 -41
- package/lib/i18n/ar.js +0 -209
- package/lib/i18n/az.d.ts +0 -15
- package/lib/i18n/az.js +0 -66
- package/lib/i18n/cz.js +0 -135
- package/lib/i18n/de.d.ts +0 -17
- package/lib/i18n/de.js +0 -103
- package/lib/i18n/dk.d.ts +0 -14
- package/lib/i18n/dk.js +0 -110
- package/lib/i18n/en.d.ts +0 -22
- package/lib/i18n/en.js +0 -86
- package/lib/i18n/es.d.ts +0 -16
- package/lib/i18n/es.js +0 -110
- package/lib/i18n/fa.d.ts +0 -54
- package/lib/i18n/fa.js +0 -106
- package/lib/i18n/fr-BE.d.ts +0 -11
- package/lib/i18n/fr-BE.js +0 -20
- package/lib/i18n/fr.d.ts +0 -15
- package/lib/i18n/fr.js +0 -99
- package/lib/i18n/he.d.ts +0 -61
- package/lib/i18n/he.js +0 -132
- package/lib/i18n/hr.d.ts +0 -68
- package/lib/i18n/hr.js +0 -129
- package/lib/i18n/hu.d.ts +0 -17
- package/lib/i18n/hu.js +0 -135
- package/lib/i18n/id.d.ts +0 -43
- package/lib/i18n/id.js +0 -156
- package/lib/i18n/it.d.ts +0 -29
- package/lib/i18n/it.js +0 -137
- package/lib/i18n/ko.d.ts +0 -15
- package/lib/i18n/ko.js +0 -56
- package/lib/i18n/lt.js +0 -138
- package/lib/i18n/lv.d.ts +0 -57
- package/lib/i18n/lv.js +0 -120
- package/lib/i18n/nl.d.ts +0 -20
- package/lib/i18n/nl.js +0 -125
- package/lib/i18n/no.d.ts +0 -15
- package/lib/i18n/no.js +0 -77
- package/lib/i18n/pl.js +0 -126
- package/lib/i18n/pt.d.ts +0 -26
- package/lib/i18n/pt.js +0 -118
- package/lib/i18n/ro.d.ts +0 -109
- package/lib/i18n/ro.js +0 -360
- package/lib/i18n/ru.d.ts +0 -30
- package/lib/i18n/ru.js +0 -198
- package/lib/i18n/sr.d.ts +0 -56
- package/lib/i18n/sr.js +0 -127
- package/lib/i18n/tr.d.ts +0 -15
- package/lib/i18n/tr.js +0 -64
- package/lib/i18n/vi.js +0 -151
- package/lib/i18n/zh.d.ts +0 -18
- package/lib/i18n/zh.js +0 -78
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { GreedyScaleLanguage } from '../classes/greedy-scale-language.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Traditional Chinese language converter.
|
|
5
|
+
*
|
|
6
|
+
* Supports:
|
|
7
|
+
* - Traditional Chinese characters (繁體中文)
|
|
8
|
+
* - No word separators (concatenated format)
|
|
9
|
+
* - Optional formal (financial) vs common numerals
|
|
10
|
+
*/
|
|
11
|
+
export class TraditionalChinese extends GreedyScaleLanguage {
|
|
12
|
+
negativeWord = '負'
|
|
13
|
+
decimalSeparatorWord = '點'
|
|
14
|
+
zeroWord = '零'
|
|
15
|
+
wordSeparator = ''
|
|
16
|
+
|
|
17
|
+
constructor (options = {}) {
|
|
18
|
+
super()
|
|
19
|
+
|
|
20
|
+
this.setOptions({
|
|
21
|
+
formal: true
|
|
22
|
+
}, options)
|
|
23
|
+
|
|
24
|
+
if (this.options.formal) {
|
|
25
|
+
this.scaleWords = [
|
|
26
|
+
[1_000_000_000_000n, '萬'],
|
|
27
|
+
[100_000_000n, '億'],
|
|
28
|
+
[10_000n, '萬'],
|
|
29
|
+
[1000n, '仟'],
|
|
30
|
+
[100n, '佰'],
|
|
31
|
+
[10n, '拾'],
|
|
32
|
+
[9n, '玖'],
|
|
33
|
+
[8n, '捌'],
|
|
34
|
+
[7n, '柒'],
|
|
35
|
+
[6n, '陸'],
|
|
36
|
+
[5n, '伍'],
|
|
37
|
+
[4n, '肆'],
|
|
38
|
+
[3n, '參'],
|
|
39
|
+
[2n, '貳'],
|
|
40
|
+
[1n, '壹'],
|
|
41
|
+
[0n, '零']
|
|
42
|
+
]
|
|
43
|
+
} else {
|
|
44
|
+
this.scaleWords = [
|
|
45
|
+
[1_000_000_000_000n, '萬'],
|
|
46
|
+
[100_000_000n, '億'],
|
|
47
|
+
[10_000n, '萬'],
|
|
48
|
+
[1000n, '千'],
|
|
49
|
+
[100n, '百'],
|
|
50
|
+
[10n, '十'],
|
|
51
|
+
[9n, '九'],
|
|
52
|
+
[8n, '八'],
|
|
53
|
+
[7n, '七'],
|
|
54
|
+
[6n, '六'],
|
|
55
|
+
[5n, '五'],
|
|
56
|
+
[4n, '四'],
|
|
57
|
+
[3n, '三'],
|
|
58
|
+
[2n, '二'],
|
|
59
|
+
[1n, '一'],
|
|
60
|
+
[0n, '零']
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Combines two word-sets with Traditional Chinese grammar rules and zero insertion. */
|
|
66
|
+
combineWordSets (preceding, following) {
|
|
67
|
+
const precedingWord = Object.keys(preceding)[0]
|
|
68
|
+
const precedingValue = Object.values(preceding)[0]
|
|
69
|
+
const followingWord = Object.keys(following)[0]
|
|
70
|
+
const followingValue = Object.values(following)[0]
|
|
71
|
+
|
|
72
|
+
// Implicit one: omit 1 before single digits (< 10)
|
|
73
|
+
if (precedingValue === 1n && followingValue < 10n) {
|
|
74
|
+
return following
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Multiply when following > preceding (scale words like 千, 萬, 億)
|
|
78
|
+
if (followingValue > precedingValue) {
|
|
79
|
+
return { [`${precedingWord}${followingWord}`]: precedingValue * followingValue }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Insert "零" (zero) when position skip levels (e.g., 1003 = 千零三)
|
|
83
|
+
// zeroDigit() checks if gap exists between preceding and following magnitude
|
|
84
|
+
if (this.zeroDigit(precedingValue) > this.digit(followingValue)) {
|
|
85
|
+
return { [`${precedingWord}${this.zeroWord}${followingWord}`]: precedingValue + followingValue }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Default: concatenate without zero insertion
|
|
89
|
+
return { [`${precedingWord}${followingWord}`]: precedingValue + followingValue }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Returns the number of digits in a number. */
|
|
93
|
+
digit (number_) {
|
|
94
|
+
return number_.toString().length
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Counts the number of zero digits in a number. */
|
|
98
|
+
zeroDigit (number_) {
|
|
99
|
+
return [...number_.toString()].filter(c => c === '0').length
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Converts decimal digits to words by reading each digit individually. */
|
|
103
|
+
decimalDigitsToWords (decimalString) {
|
|
104
|
+
const words = []
|
|
105
|
+
for (let i = 0; i < decimalString.length; i++) {
|
|
106
|
+
const digitValue = BigInt(decimalString[i])
|
|
107
|
+
words.push(this.integerToWords(digitValue))
|
|
108
|
+
}
|
|
109
|
+
return words
|
|
110
|
+
}
|
|
111
|
+
}
|
package/lib/n2words.d.ts
CHANGED
|
@@ -1,9 +1,209 @@
|
|
|
1
|
-
export default floatToCardinal;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @param {object} [options] User options.
|
|
6
|
-
* @returns {string} Value in written format.
|
|
7
|
-
* TODO [2024-06] Migrate to object destructing for parameters
|
|
2
|
+
* Numeric value that can be converted to words.
|
|
3
|
+
* Accepts number, bigint, or numeric string representations.
|
|
8
4
|
*/
|
|
9
|
-
|
|
5
|
+
export type NumericValue = number | bigint | string;
|
|
6
|
+
export type ArabicOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* Word for negative numbers
|
|
9
|
+
*/
|
|
10
|
+
negativeWord?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Grammatical gender for number forms
|
|
13
|
+
*/
|
|
14
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type BiblicalHebrewOptions = {
|
|
17
|
+
/**
|
|
18
|
+
* Conjunction character (typically 'ו' for and)
|
|
19
|
+
*/
|
|
20
|
+
andWord?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Grammatical gender for number forms
|
|
23
|
+
*/
|
|
24
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
25
|
+
};
|
|
26
|
+
export type CroatianOptions = {
|
|
27
|
+
/**
|
|
28
|
+
* Grammatical gender for number forms
|
|
29
|
+
*/
|
|
30
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
31
|
+
};
|
|
32
|
+
export type CzechOptions = {
|
|
33
|
+
/**
|
|
34
|
+
* Grammatical gender for number forms
|
|
35
|
+
*/
|
|
36
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
37
|
+
};
|
|
38
|
+
export type DanishOptions = {
|
|
39
|
+
/**
|
|
40
|
+
* Enable ordinal number conversion
|
|
41
|
+
*/
|
|
42
|
+
ordFlag?: boolean | undefined;
|
|
43
|
+
};
|
|
44
|
+
export type DutchOptions = {
|
|
45
|
+
/**
|
|
46
|
+
* Include optional "en" separator
|
|
47
|
+
*/
|
|
48
|
+
includeOptionalAnd?: boolean | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Disable hundred-pairing (e.g., "twelve hundred" becomes "one thousand two hundred")
|
|
51
|
+
*/
|
|
52
|
+
noHundredPairing?: boolean | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Use accented "één" for one
|
|
55
|
+
*/
|
|
56
|
+
accentOne?: boolean | undefined;
|
|
57
|
+
};
|
|
58
|
+
export type FrenchOptions = {
|
|
59
|
+
/**
|
|
60
|
+
* Use hyphens (true) instead of spaces (false) in compounds
|
|
61
|
+
*/
|
|
62
|
+
withHyphenSeparator?: boolean | undefined;
|
|
63
|
+
};
|
|
64
|
+
export type FrenchBelgiumOptions = {
|
|
65
|
+
/**
|
|
66
|
+
* Use hyphens (true) instead of spaces (false) in compounds
|
|
67
|
+
*/
|
|
68
|
+
withHyphenSeparator?: boolean | undefined;
|
|
69
|
+
};
|
|
70
|
+
export type HebrewOptions = {
|
|
71
|
+
/**
|
|
72
|
+
* Conjunction character (typically 'ו' for and)
|
|
73
|
+
*/
|
|
74
|
+
andWord?: string | undefined;
|
|
75
|
+
};
|
|
76
|
+
export type LatvianOptions = {
|
|
77
|
+
/**
|
|
78
|
+
* Grammatical gender for number forms
|
|
79
|
+
*/
|
|
80
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
81
|
+
};
|
|
82
|
+
export type LithuanianOptions = {
|
|
83
|
+
/**
|
|
84
|
+
* Grammatical gender for number forms
|
|
85
|
+
*/
|
|
86
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
87
|
+
};
|
|
88
|
+
export type PolishOptions = {
|
|
89
|
+
/**
|
|
90
|
+
* Grammatical gender for number forms
|
|
91
|
+
*/
|
|
92
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
93
|
+
};
|
|
94
|
+
export type RomanianOptions = {
|
|
95
|
+
/**
|
|
96
|
+
* Grammatical gender for number forms
|
|
97
|
+
*/
|
|
98
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
99
|
+
};
|
|
100
|
+
export type RussianOptions = {
|
|
101
|
+
/**
|
|
102
|
+
* Grammatical gender for number forms
|
|
103
|
+
*/
|
|
104
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
105
|
+
};
|
|
106
|
+
export type SerbianCyrillicOptions = {
|
|
107
|
+
/**
|
|
108
|
+
* Grammatical gender for number forms
|
|
109
|
+
*/
|
|
110
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
111
|
+
};
|
|
112
|
+
export type SerbianLatinOptions = {
|
|
113
|
+
/**
|
|
114
|
+
* Grammatical gender for number forms
|
|
115
|
+
*/
|
|
116
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
117
|
+
};
|
|
118
|
+
export type SimplifiedChineseOptions = {
|
|
119
|
+
/**
|
|
120
|
+
* Use formal/financial numerals (壹贰叁) vs. common numerals (一二三)
|
|
121
|
+
*/
|
|
122
|
+
formal?: boolean | undefined;
|
|
123
|
+
};
|
|
124
|
+
export type SpanishOptions = {
|
|
125
|
+
/**
|
|
126
|
+
* Grammatical gender for number forms
|
|
127
|
+
*/
|
|
128
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
129
|
+
};
|
|
130
|
+
export type TraditionalChineseOptions = {
|
|
131
|
+
/**
|
|
132
|
+
* Use formal/financial numerals (壹貳參) vs. common numerals (一二三)
|
|
133
|
+
*/
|
|
134
|
+
formal?: boolean | undefined;
|
|
135
|
+
};
|
|
136
|
+
export type TurkishOptions = {
|
|
137
|
+
/**
|
|
138
|
+
* Remove spaces between words if true
|
|
139
|
+
*/
|
|
140
|
+
dropSpaces?: boolean | undefined;
|
|
141
|
+
};
|
|
142
|
+
export type UkrainianOptions = {
|
|
143
|
+
/**
|
|
144
|
+
* Grammatical gender for number forms
|
|
145
|
+
*/
|
|
146
|
+
gender?: "feminine" | "masculine" | undefined;
|
|
147
|
+
};
|
|
148
|
+
export type ParsedNumericValue = {
|
|
149
|
+
/**
|
|
150
|
+
* - Whether the value is negative
|
|
151
|
+
*/
|
|
152
|
+
isNegative: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* - The absolute integer part
|
|
155
|
+
*/
|
|
156
|
+
integerPart: bigint;
|
|
157
|
+
/**
|
|
158
|
+
* - The decimal digits (without the point)
|
|
159
|
+
*/
|
|
160
|
+
decimalPart?: string | undefined;
|
|
161
|
+
};
|
|
162
|
+
export const ArabicConverter: (value: NumericValue, options?: ArabicOptions) => string;
|
|
163
|
+
export const AzerbaijaniConverter: (value: NumericValue) => string;
|
|
164
|
+
export const BanglaConverter: (value: NumericValue) => string;
|
|
165
|
+
export const BiblicalHebrewConverter: (value: NumericValue, options?: BiblicalHebrewOptions) => string;
|
|
166
|
+
export const CroatianConverter: (value: NumericValue, options?: CroatianOptions) => string;
|
|
167
|
+
export const CzechConverter: (value: NumericValue, options?: CzechOptions) => string;
|
|
168
|
+
export const DanishConverter: (value: NumericValue, options?: DanishOptions) => string;
|
|
169
|
+
export const DutchConverter: (value: NumericValue, options?: DutchOptions) => string;
|
|
170
|
+
export const EnglishConverter: (value: NumericValue) => string;
|
|
171
|
+
export const FilipinoConverter: (value: NumericValue) => string;
|
|
172
|
+
export const FrenchConverter: (value: NumericValue, options?: FrenchOptions) => string;
|
|
173
|
+
export const FrenchBelgiumConverter: (value: NumericValue, options?: FrenchBelgiumOptions) => string;
|
|
174
|
+
export const GermanConverter: (value: NumericValue) => string;
|
|
175
|
+
export const GreekConverter: (value: NumericValue) => string;
|
|
176
|
+
export const GujaratiConverter: (value: NumericValue) => string;
|
|
177
|
+
export const HebrewConverter: (value: NumericValue, options?: HebrewOptions) => string;
|
|
178
|
+
export const HindiConverter: (value: NumericValue) => string;
|
|
179
|
+
export const HungarianConverter: (value: NumericValue) => string;
|
|
180
|
+
export const IndonesianConverter: (value: NumericValue) => string;
|
|
181
|
+
export const ItalianConverter: (value: NumericValue) => string;
|
|
182
|
+
export const JapaneseConverter: (value: NumericValue) => string;
|
|
183
|
+
export const KannadaConverter: (value: NumericValue) => string;
|
|
184
|
+
export const KoreanConverter: (value: NumericValue) => string;
|
|
185
|
+
export const LatvianConverter: (value: NumericValue, options?: LatvianOptions) => string;
|
|
186
|
+
export const LithuanianConverter: (value: NumericValue, options?: LithuanianOptions) => string;
|
|
187
|
+
export const MalayConverter: (value: NumericValue) => string;
|
|
188
|
+
export const MarathiConverter: (value: NumericValue) => string;
|
|
189
|
+
export const NorwegianBokmalConverter: (value: NumericValue) => string;
|
|
190
|
+
export const PersianConverter: (value: NumericValue) => string;
|
|
191
|
+
export const PolishConverter: (value: NumericValue, options?: PolishOptions) => string;
|
|
192
|
+
export const PortugueseConverter: (value: NumericValue) => string;
|
|
193
|
+
export const PunjabiConverter: (value: NumericValue) => string;
|
|
194
|
+
export const RomanianConverter: (value: NumericValue, options?: RomanianOptions) => string;
|
|
195
|
+
export const RussianConverter: (value: NumericValue, options?: RussianOptions) => string;
|
|
196
|
+
export const SerbianCyrillicConverter: (value: NumericValue, options?: SerbianCyrillicOptions) => string;
|
|
197
|
+
export const SerbianLatinConverter: (value: NumericValue, options?: SerbianLatinOptions) => string;
|
|
198
|
+
export const SimplifiedChineseConverter: (value: NumericValue, options?: SimplifiedChineseOptions) => string;
|
|
199
|
+
export const SpanishConverter: (value: NumericValue, options?: SpanishOptions) => string;
|
|
200
|
+
export const SwahiliConverter: (value: NumericValue) => string;
|
|
201
|
+
export const SwedishConverter: (value: NumericValue) => string;
|
|
202
|
+
export const TamilConverter: (value: NumericValue) => string;
|
|
203
|
+
export const TeluguConverter: (value: NumericValue) => string;
|
|
204
|
+
export const ThaiConverter: (value: NumericValue) => string;
|
|
205
|
+
export const TraditionalChineseConverter: (value: NumericValue, options?: TraditionalChineseOptions) => string;
|
|
206
|
+
export const TurkishConverter: (value: NumericValue, options?: TurkishOptions) => string;
|
|
207
|
+
export const UkrainianConverter: (value: NumericValue, options?: UkrainianOptions) => string;
|
|
208
|
+
export const UrduConverter: (value: NumericValue) => string;
|
|
209
|
+
export const VietnameseConverter: (value: NumericValue) => string;
|