n2words 1.16.3 → 1.17.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/README.md +1 -1
- package/dist/n2words.js +1 -1
- package/dist/n2words.js.map +1 -1
- package/lib/classes/AbstractLanguage.d.ts +2 -2
- package/lib/classes/AbstractLanguage.js +16 -7
- package/lib/classes/BaseLanguage.d.ts +0 -1
- package/lib/classes/BaseLanguage.js +0 -4
- package/lib/i18n/ar.d.ts +8 -7
- package/lib/i18n/ar.js +82 -44
- package/lib/i18n/az.d.ts +2 -2
- package/lib/i18n/az.js +6 -4
- package/lib/i18n/cz.d.ts +58 -2
- package/lib/i18n/cz.js +6 -4
- package/lib/i18n/de.d.ts +2 -2
- package/lib/i18n/de.js +6 -4
- package/lib/i18n/dk.d.ts +2 -2
- package/lib/i18n/dk.js +3 -3
- package/lib/i18n/en.d.ts +2 -2
- package/lib/i18n/en.js +6 -4
- package/lib/i18n/es.d.ts +2 -2
- package/lib/i18n/es.js +2 -2
- package/lib/i18n/fa.d.ts +2 -2
- package/lib/i18n/fa.js +6 -4
- package/lib/i18n/fr.d.ts +2 -2
- package/lib/i18n/fr.js +6 -4
- package/lib/i18n/he.d.ts +35 -2
- package/lib/i18n/he.js +11 -6
- package/lib/i18n/hr.d.ts +35 -2
- package/lib/i18n/hr.js +6 -4
- package/lib/i18n/hu.d.ts +2 -2
- package/lib/i18n/hu.js +6 -4
- package/lib/i18n/id.d.ts +2 -2
- package/lib/i18n/id.js +6 -4
- package/lib/i18n/it.d.ts +2 -2
- package/lib/i18n/it.js +6 -4
- package/lib/i18n/ko.d.ts +2 -2
- package/lib/i18n/ko.js +6 -4
- package/lib/i18n/lt.d.ts +58 -2
- package/lib/i18n/lt.js +6 -4
- package/lib/i18n/lv.d.ts +47 -2
- package/lib/i18n/lv.js +6 -4
- package/lib/i18n/nl.d.ts +2 -2
- package/lib/i18n/nl.js +2 -2
- package/lib/i18n/no.d.ts +2 -2
- package/lib/i18n/no.js +6 -4
- package/lib/i18n/pl.d.ts +58 -2
- package/lib/i18n/pl.js +6 -4
- package/lib/i18n/pt.d.ts +2 -2
- package/lib/i18n/pt.js +6 -4
- package/lib/i18n/ru.d.ts +17 -71
- package/lib/i18n/ru.js +18 -24
- package/lib/i18n/sr.d.ts +35 -14
- package/lib/i18n/sr.js +15 -15
- package/lib/i18n/tr.d.ts +2 -2
- package/lib/i18n/tr.js +2 -2
- package/lib/i18n/uk.d.ts +69 -2
- package/lib/i18n/uk.js +2 -2
- package/lib/i18n/vi.d.ts +2 -2
- package/lib/i18n/vi.js +2 -2
- package/lib/i18n/zh.d.ts +2 -2
- package/lib/i18n/zh.js +2 -2
- package/package.json +18 -17
package/lib/i18n/pl.d.ts
CHANGED
|
@@ -1,11 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a value to cardinal (written) form.
|
|
3
3
|
* @param {number|string} value Number to be convert.
|
|
4
|
-
* @param {object} options Options for class.
|
|
4
|
+
* @param {object} [options] Options for class.
|
|
5
5
|
* @throws {Error} Value cannot be invalid.
|
|
6
6
|
* @returns {string} Value in cardinal (written) format.
|
|
7
7
|
*/
|
|
8
|
-
export default function _default(value: number | string, options
|
|
8
|
+
export default function _default(value: number | string, options?: object): string;
|
|
9
9
|
export class N2WordsPL extends N2WordsRU {
|
|
10
|
+
ones: {
|
|
11
|
+
1: string;
|
|
12
|
+
2: string;
|
|
13
|
+
3: string;
|
|
14
|
+
4: string;
|
|
15
|
+
5: string;
|
|
16
|
+
6: string;
|
|
17
|
+
7: string;
|
|
18
|
+
8: string;
|
|
19
|
+
9: string;
|
|
20
|
+
};
|
|
21
|
+
tens: {
|
|
22
|
+
0: string;
|
|
23
|
+
1: string;
|
|
24
|
+
2: string;
|
|
25
|
+
3: string;
|
|
26
|
+
4: string;
|
|
27
|
+
5: string;
|
|
28
|
+
6: string;
|
|
29
|
+
7: string;
|
|
30
|
+
8: string;
|
|
31
|
+
9: string;
|
|
32
|
+
};
|
|
33
|
+
twenties: {
|
|
34
|
+
2: string;
|
|
35
|
+
3: string;
|
|
36
|
+
4: string;
|
|
37
|
+
5: string;
|
|
38
|
+
6: string;
|
|
39
|
+
7: string;
|
|
40
|
+
8: string;
|
|
41
|
+
9: string;
|
|
42
|
+
};
|
|
43
|
+
hundreds: {
|
|
44
|
+
1: string;
|
|
45
|
+
2: string;
|
|
46
|
+
3: string;
|
|
47
|
+
4: string;
|
|
48
|
+
5: string;
|
|
49
|
+
6: string;
|
|
50
|
+
7: string;
|
|
51
|
+
8: string;
|
|
52
|
+
9: string;
|
|
53
|
+
};
|
|
54
|
+
thousands: {
|
|
55
|
+
1: string[];
|
|
56
|
+
2: string[];
|
|
57
|
+
3: string[];
|
|
58
|
+
4: string[];
|
|
59
|
+
5: string[];
|
|
60
|
+
6: string[];
|
|
61
|
+
7: string[];
|
|
62
|
+
8: string[];
|
|
63
|
+
9: string[];
|
|
64
|
+
10: string[];
|
|
65
|
+
};
|
|
10
66
|
}
|
|
11
67
|
import { N2WordsRU } from './ru.js';
|
package/lib/i18n/pl.js
CHANGED
|
@@ -63,11 +63,13 @@ export class N2WordsPL extends N2WordsRU {
|
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
constructor(options) {
|
|
66
|
-
|
|
66
|
+
options = Object.assign({
|
|
67
67
|
negativeWord: 'minus',
|
|
68
68
|
separatorWord: 'przecinek',
|
|
69
69
|
zero: 'zero'
|
|
70
|
-
}, options)
|
|
70
|
+
}, options);
|
|
71
|
+
|
|
72
|
+
super(options);
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
pluralize(n, forms) {
|
|
@@ -116,10 +118,10 @@ export class N2WordsPL extends N2WordsRU {
|
|
|
116
118
|
/**
|
|
117
119
|
* Converts a value to cardinal (written) form.
|
|
118
120
|
* @param {number|string} value Number to be convert.
|
|
119
|
-
* @param {object} options Options for class.
|
|
121
|
+
* @param {object} [options] Options for class.
|
|
120
122
|
* @throws {Error} Value cannot be invalid.
|
|
121
123
|
* @returns {string} Value in cardinal (written) format.
|
|
122
124
|
*/
|
|
123
|
-
export default function (value, options) {
|
|
125
|
+
export default function (value, options = {}) {
|
|
124
126
|
return new N2WordsPL(options).floatToCardinal(value);
|
|
125
127
|
}
|
package/lib/i18n/pt.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a value to cardinal (written) form.
|
|
3
3
|
* @param {number|string} value Number to be convert.
|
|
4
|
-
* @param {object} options Options for class.
|
|
4
|
+
* @param {object} [options] Options for class.
|
|
5
5
|
* @throws {Error} Value cannot be invalid.
|
|
6
6
|
* @returns {string} Value in cardinal (written) format.
|
|
7
7
|
*/
|
|
8
|
-
export default function _default(value: number | string, options
|
|
8
|
+
export default function _default(value: number | string, options?: object): string;
|
|
9
9
|
export class N2WordsPT extends BaseLanguage {
|
|
10
10
|
constructor(options: any);
|
|
11
11
|
hundreds: {
|
package/lib/i18n/pt.js
CHANGED
|
@@ -14,11 +14,13 @@ export class N2WordsPT extends BaseLanguage {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
constructor(options) {
|
|
17
|
-
|
|
17
|
+
options = Object.assign({
|
|
18
18
|
negativeWord: 'menos',
|
|
19
19
|
separatorWord: 'vírgula',
|
|
20
20
|
zero: 'zero'
|
|
21
|
-
}, options)
|
|
21
|
+
}, options);
|
|
22
|
+
|
|
23
|
+
super(options, [
|
|
22
24
|
[1000000000000000000000000n, 'quatrilião'],
|
|
23
25
|
[1000000000000000000n, 'trilião'],
|
|
24
26
|
[1000000000000n, 'bilião'],
|
|
@@ -107,10 +109,10 @@ export class N2WordsPT extends BaseLanguage {
|
|
|
107
109
|
/**
|
|
108
110
|
* Converts a value to cardinal (written) form.
|
|
109
111
|
* @param {number|string} value Number to be convert.
|
|
110
|
-
* @param {object} options Options for class.
|
|
112
|
+
* @param {object} [options] Options for class.
|
|
111
113
|
* @throws {Error} Value cannot be invalid.
|
|
112
114
|
* @returns {string} Value in cardinal (written) format.
|
|
113
115
|
*/
|
|
114
|
-
export default function (value, options) {
|
|
116
|
+
export default function (value, options = {}) {
|
|
115
117
|
return new N2WordsPT(options).floatToCardinal(value);
|
|
116
118
|
}
|
package/lib/i18n/ru.d.ts
CHANGED
|
@@ -1,83 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a value to cardinal (written) form.
|
|
3
3
|
* @param {number|string} value Number to be convert.
|
|
4
|
-
* @param {object} options Options for class.
|
|
4
|
+
* @param {object} [options] Options for class.
|
|
5
5
|
* @throws {Error} Value cannot be invalid.
|
|
6
6
|
* @returns {string} Value in cardinal (written) format.
|
|
7
7
|
*/
|
|
8
|
-
export default function _default(value: number | string, options
|
|
8
|
+
export default function _default(value: number | string, options?: object): string;
|
|
9
9
|
export class N2WordsRU extends AbstractLanguage {
|
|
10
10
|
constructor(options: any);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
2: string;
|
|
26
|
-
3: string;
|
|
27
|
-
4: string;
|
|
28
|
-
5: string;
|
|
29
|
-
6: string;
|
|
30
|
-
7: string;
|
|
31
|
-
8: string;
|
|
32
|
-
9: string;
|
|
33
|
-
};
|
|
34
|
-
tens: {
|
|
35
|
-
0: string;
|
|
36
|
-
1: string;
|
|
37
|
-
2: string;
|
|
38
|
-
3: string;
|
|
39
|
-
4: string;
|
|
40
|
-
5: string;
|
|
41
|
-
6: string;
|
|
42
|
-
7: string;
|
|
43
|
-
8: string;
|
|
44
|
-
9: string;
|
|
45
|
-
};
|
|
46
|
-
twenties: {
|
|
47
|
-
2: string;
|
|
48
|
-
3: string;
|
|
49
|
-
4: string;
|
|
50
|
-
5: string;
|
|
51
|
-
6: string;
|
|
52
|
-
7: string;
|
|
53
|
-
8: string;
|
|
54
|
-
9: string;
|
|
55
|
-
};
|
|
56
|
-
hundreds: {
|
|
57
|
-
1: string;
|
|
58
|
-
2: string;
|
|
59
|
-
3: string;
|
|
60
|
-
4: string;
|
|
61
|
-
5: string;
|
|
62
|
-
6: string;
|
|
63
|
-
7: string;
|
|
64
|
-
8: string;
|
|
65
|
-
9: string;
|
|
66
|
-
};
|
|
67
|
-
thousands: {
|
|
68
|
-
1: string[];
|
|
69
|
-
2: string[];
|
|
70
|
-
3: string[];
|
|
71
|
-
4: string[];
|
|
72
|
-
5: string[];
|
|
73
|
-
6: string[];
|
|
74
|
-
7: string[];
|
|
75
|
-
8: string[];
|
|
76
|
-
9: string[];
|
|
77
|
-
10: string[];
|
|
78
|
-
};
|
|
11
|
+
/** @type {boolean} */
|
|
12
|
+
feminine: boolean;
|
|
13
|
+
/** @type {object} */
|
|
14
|
+
ones: object;
|
|
15
|
+
/** @type {object} */
|
|
16
|
+
onesFeminine: object;
|
|
17
|
+
/** @type {object} */
|
|
18
|
+
tens: object;
|
|
19
|
+
/** @type {object} */
|
|
20
|
+
twenties: object;
|
|
21
|
+
/** @type {object} */
|
|
22
|
+
hundreds: object;
|
|
23
|
+
/** @type {object} */
|
|
24
|
+
thousands: object;
|
|
79
25
|
toCardinal(number: any): string;
|
|
80
|
-
splitByX(n: any, x: any
|
|
26
|
+
splitByX(n: any, x: any): bigint[];
|
|
81
27
|
getDigits(value: any): bigint[];
|
|
82
28
|
pluralize(n: any, forms: any): any;
|
|
83
29
|
}
|
package/lib/i18n/ru.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import AbstractLanguage from '../classes/AbstractLanguage.js';
|
|
2
2
|
|
|
3
3
|
export class N2WordsRU extends AbstractLanguage {
|
|
4
|
+
/** @type {boolean} */
|
|
4
5
|
feminine;
|
|
5
6
|
|
|
7
|
+
/** @type {object} */
|
|
6
8
|
ones = {
|
|
7
9
|
1: 'один',
|
|
8
10
|
2: 'два',
|
|
@@ -15,6 +17,7 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
15
17
|
9: 'девять'
|
|
16
18
|
};
|
|
17
19
|
|
|
20
|
+
/** @type {object} */
|
|
18
21
|
onesFeminine = {
|
|
19
22
|
1: 'одна',
|
|
20
23
|
2: 'две',
|
|
@@ -27,6 +30,7 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
27
30
|
9: 'девять'
|
|
28
31
|
};
|
|
29
32
|
|
|
33
|
+
/** @type {object} */
|
|
30
34
|
tens = {
|
|
31
35
|
0: 'десять',
|
|
32
36
|
1: 'одиннадцать',
|
|
@@ -40,6 +44,7 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
40
44
|
9: 'девятнадцать'
|
|
41
45
|
};
|
|
42
46
|
|
|
47
|
+
/** @type {object} */
|
|
43
48
|
twenties = {
|
|
44
49
|
2: 'двадцать',
|
|
45
50
|
3: 'тридцать',
|
|
@@ -51,6 +56,7 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
51
56
|
9: 'девяносто'
|
|
52
57
|
};
|
|
53
58
|
|
|
59
|
+
/** @type {object} */
|
|
54
60
|
hundreds = {
|
|
55
61
|
1: 'сто',
|
|
56
62
|
2: 'двести',
|
|
@@ -63,6 +69,7 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
63
69
|
9: 'девятьсот'
|
|
64
70
|
};
|
|
65
71
|
|
|
72
|
+
/** @type {object} */
|
|
66
73
|
thousands = {
|
|
67
74
|
1: ['тысяча', 'тысячи', 'тысяч'], // 10^ 3
|
|
68
75
|
2: ['миллион', 'миллиона', 'миллионов'], // 10^ 6
|
|
@@ -77,15 +84,14 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
77
84
|
};
|
|
78
85
|
|
|
79
86
|
constructor(options) {
|
|
80
|
-
|
|
87
|
+
options = Object.assign({
|
|
81
88
|
negativeWord: 'минус',
|
|
82
89
|
separatorWord: 'запятая',
|
|
83
|
-
zero: 'ноль'
|
|
84
|
-
|
|
90
|
+
zero: 'ноль',
|
|
91
|
+
feminine: false
|
|
92
|
+
}, options);
|
|
85
93
|
|
|
86
|
-
options
|
|
87
|
-
feminine: false,
|
|
88
|
-
});
|
|
94
|
+
super(options);
|
|
89
95
|
|
|
90
96
|
this.feminine = options.feminine;
|
|
91
97
|
}
|
|
@@ -135,7 +141,7 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
135
141
|
return words.join(' ');
|
|
136
142
|
}
|
|
137
143
|
|
|
138
|
-
splitByX(n, x
|
|
144
|
+
splitByX(n, x) {
|
|
139
145
|
const results = [];
|
|
140
146
|
const l = n.length;
|
|
141
147
|
let result;
|
|
@@ -146,28 +152,16 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
146
152
|
if (start > 0) {
|
|
147
153
|
result = n.slice(0, start);
|
|
148
154
|
|
|
149
|
-
|
|
150
|
-
results.push(BigInt(result));
|
|
151
|
-
} else {
|
|
152
|
-
results.push(result);
|
|
153
|
-
}
|
|
155
|
+
results.push(BigInt(result));
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
for (let i = start; i < l; i += x) {
|
|
157
159
|
result = n.slice(i, i + x);
|
|
158
160
|
|
|
159
|
-
|
|
160
|
-
results.push(BigInt(result));
|
|
161
|
-
} else {
|
|
162
|
-
results.push(result);
|
|
163
|
-
}
|
|
161
|
+
results.push(BigInt(result));
|
|
164
162
|
}
|
|
165
163
|
} else {
|
|
166
|
-
|
|
167
|
-
results.push(BigInt(n));
|
|
168
|
-
} else {
|
|
169
|
-
results.push(n);
|
|
170
|
-
}
|
|
164
|
+
results.push(BigInt(n));
|
|
171
165
|
}
|
|
172
166
|
|
|
173
167
|
return results;
|
|
@@ -194,10 +188,10 @@ export class N2WordsRU extends AbstractLanguage {
|
|
|
194
188
|
/**
|
|
195
189
|
* Converts a value to cardinal (written) form.
|
|
196
190
|
* @param {number|string} value Number to be convert.
|
|
197
|
-
* @param {object} options Options for class.
|
|
191
|
+
* @param {object} [options] Options for class.
|
|
198
192
|
* @throws {Error} Value cannot be invalid.
|
|
199
193
|
* @returns {string} Value in cardinal (written) format.
|
|
200
194
|
*/
|
|
201
|
-
export default function (value, options) {
|
|
195
|
+
export default function (value, options = {}) {
|
|
202
196
|
return new N2WordsRU(options).floatToCardinal(value);
|
|
203
197
|
}
|
package/lib/i18n/sr.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a value to cardinal (written) form.
|
|
3
3
|
* @param {number|string} value Number to be convert.
|
|
4
|
-
* @param {object} options Options for class.
|
|
4
|
+
* @param {object} [options] Options for class.
|
|
5
5
|
* @throws {Error} Value cannot be invalid.
|
|
6
6
|
* @returns {string} Value in cardinal (written) format.
|
|
7
7
|
*/
|
|
8
|
-
export default function _default(value: number | string, options
|
|
8
|
+
export default function _default(value: number | string, options?: object): string;
|
|
9
9
|
export class N2WordsSR extends N2WordsRU {
|
|
10
10
|
ones: {
|
|
11
11
|
1: string[];
|
|
@@ -18,18 +18,39 @@ export class N2WordsSR extends N2WordsRU {
|
|
|
18
18
|
8: string[];
|
|
19
19
|
9: string[];
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
0:
|
|
23
|
-
1:
|
|
24
|
-
2:
|
|
25
|
-
3:
|
|
26
|
-
4:
|
|
27
|
-
5:
|
|
28
|
-
6:
|
|
29
|
-
7:
|
|
30
|
-
8:
|
|
31
|
-
9:
|
|
32
|
-
10: (string | boolean)[];
|
|
21
|
+
tens: {
|
|
22
|
+
0: string;
|
|
23
|
+
1: string;
|
|
24
|
+
2: string;
|
|
25
|
+
3: string;
|
|
26
|
+
4: string;
|
|
27
|
+
5: string;
|
|
28
|
+
6: string;
|
|
29
|
+
7: string;
|
|
30
|
+
8: string;
|
|
31
|
+
9: string;
|
|
33
32
|
};
|
|
33
|
+
twenties: {
|
|
34
|
+
2: string;
|
|
35
|
+
3: string;
|
|
36
|
+
4: string;
|
|
37
|
+
5: string;
|
|
38
|
+
6: string;
|
|
39
|
+
7: string;
|
|
40
|
+
8: string;
|
|
41
|
+
9: string;
|
|
42
|
+
};
|
|
43
|
+
hundreds: {
|
|
44
|
+
1: string;
|
|
45
|
+
2: string;
|
|
46
|
+
3: string;
|
|
47
|
+
4: string;
|
|
48
|
+
5: string;
|
|
49
|
+
6: string;
|
|
50
|
+
7: string;
|
|
51
|
+
8: string;
|
|
52
|
+
9: string;
|
|
53
|
+
};
|
|
54
|
+
SCALE: (string | boolean)[][];
|
|
34
55
|
}
|
|
35
56
|
import { N2WordsRU } from './ru.js';
|
package/lib/i18n/sr.js
CHANGED
|
@@ -49,19 +49,19 @@ export class N2WordsSR extends N2WordsRU {
|
|
|
49
49
|
9: 'devetsto'
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
SCALE =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
52
|
+
SCALE = [
|
|
53
|
+
['', '', '', false],
|
|
54
|
+
['hiljada', 'hiljade', 'hiljada', true], // 10 ^ 3
|
|
55
|
+
['milion', 'miliona', 'miliona', false], // 10 ^ 6
|
|
56
|
+
['milijarda', 'milijarde', 'milijarda', false], // 10 ^ 9
|
|
57
|
+
['bilion', 'biliona', 'biliona', false], // 10 ^ 12
|
|
58
|
+
['bilijarda', 'bilijarde', 'bilijarda', false], // 10 ^ 15
|
|
59
|
+
['trilion', 'triliona', 'triliona', false], // 10 ^ 18
|
|
60
|
+
['trilijarda', 'trilijarde', 'trilijarda', false], // 10 ^ 21
|
|
61
|
+
['kvadrilion', 'kvadriliona', 'kvadriliona', false], // 10 ^ 24
|
|
62
|
+
['kvadrilijarda', 'kvadrilijarde', 'kvadrilijarda', false], // 10 ^ 27
|
|
63
|
+
['kvintilion', 'kvintiliona', 'kvintiliona', false], // 10 ^ 30
|
|
64
|
+
];
|
|
65
65
|
|
|
66
66
|
constructor(options) {
|
|
67
67
|
super(Object.assign({
|
|
@@ -119,10 +119,10 @@ export class N2WordsSR extends N2WordsRU {
|
|
|
119
119
|
/**
|
|
120
120
|
* Converts a value to cardinal (written) form.
|
|
121
121
|
* @param {number|string} value Number to be convert.
|
|
122
|
-
* @param {object} options Options for class.
|
|
122
|
+
* @param {object} [options] Options for class.
|
|
123
123
|
* @throws {Error} Value cannot be invalid.
|
|
124
124
|
* @returns {string} Value in cardinal (written) format.
|
|
125
125
|
*/
|
|
126
|
-
export default function (value, options) {
|
|
126
|
+
export default function (value, options = {}) {
|
|
127
127
|
return new N2WordsSR(options).floatToCardinal(value);
|
|
128
128
|
}
|
package/lib/i18n/tr.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a value to cardinal (written) form.
|
|
3
3
|
* @param {number|string} value Number to be convert.
|
|
4
|
-
* @param {object} options Options for class.
|
|
4
|
+
* @param {object} [options] Options for class.
|
|
5
5
|
* @throws {Error} Value cannot be invalid.
|
|
6
6
|
* @returns {string} Value in cardinal (written) format.
|
|
7
7
|
*/
|
|
8
|
-
export default function _default(value: number | string, options
|
|
8
|
+
export default function _default(value: number | string, options?: object): string;
|
|
9
9
|
export class N2WordsTR extends BaseLanguage {
|
|
10
10
|
constructor(options?: {});
|
|
11
11
|
merge(lPair: any, rPair: any): {
|
package/lib/i18n/tr.js
CHANGED
|
@@ -55,10 +55,10 @@ export class N2WordsTR extends BaseLanguage {
|
|
|
55
55
|
/**
|
|
56
56
|
* Converts a value to cardinal (written) form.
|
|
57
57
|
* @param {number|string} value Number to be convert.
|
|
58
|
-
* @param {object} options Options for class.
|
|
58
|
+
* @param {object} [options] Options for class.
|
|
59
59
|
* @throws {Error} Value cannot be invalid.
|
|
60
60
|
* @returns {string} Value in cardinal (written) format.
|
|
61
61
|
*/
|
|
62
|
-
export default function (value, options) {
|
|
62
|
+
export default function (value, options = {}) {
|
|
63
63
|
return new N2WordsTR(options).floatToCardinal(value);
|
|
64
64
|
}
|
package/lib/i18n/uk.d.ts
CHANGED
|
@@ -1,11 +1,78 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a value to cardinal (written) form.
|
|
3
3
|
* @param {number|string} value Number to be convert.
|
|
4
|
-
* @param {object} options Options for class.
|
|
4
|
+
* @param {object} [options] Options for class.
|
|
5
5
|
* @throws {Error} Value cannot be invalid.
|
|
6
6
|
* @returns {string} Value in cardinal (written) format.
|
|
7
7
|
*/
|
|
8
|
-
export default function _default(value: number | string, options
|
|
8
|
+
export default function _default(value: number | string, options?: object): string;
|
|
9
9
|
export class N2WordsUK extends N2WordsRU {
|
|
10
|
+
ones: {
|
|
11
|
+
1: string;
|
|
12
|
+
2: string;
|
|
13
|
+
3: string;
|
|
14
|
+
4: string;
|
|
15
|
+
5: string;
|
|
16
|
+
6: string;
|
|
17
|
+
7: string;
|
|
18
|
+
8: string;
|
|
19
|
+
9: string;
|
|
20
|
+
};
|
|
21
|
+
onesFeminine: {
|
|
22
|
+
1: string;
|
|
23
|
+
2: string;
|
|
24
|
+
3: string;
|
|
25
|
+
4: string;
|
|
26
|
+
5: string;
|
|
27
|
+
6: string;
|
|
28
|
+
7: string;
|
|
29
|
+
8: string;
|
|
30
|
+
9: string;
|
|
31
|
+
};
|
|
32
|
+
tens: {
|
|
33
|
+
0: string;
|
|
34
|
+
1: string;
|
|
35
|
+
2: string;
|
|
36
|
+
3: string;
|
|
37
|
+
4: string;
|
|
38
|
+
5: string;
|
|
39
|
+
6: string;
|
|
40
|
+
7: string;
|
|
41
|
+
8: string;
|
|
42
|
+
9: string;
|
|
43
|
+
};
|
|
44
|
+
twenties: {
|
|
45
|
+
2: string;
|
|
46
|
+
3: string;
|
|
47
|
+
4: string;
|
|
48
|
+
5: string;
|
|
49
|
+
6: string;
|
|
50
|
+
7: string;
|
|
51
|
+
8: string;
|
|
52
|
+
9: string;
|
|
53
|
+
};
|
|
54
|
+
hundreds: {
|
|
55
|
+
1: string;
|
|
56
|
+
2: string;
|
|
57
|
+
3: string;
|
|
58
|
+
4: string;
|
|
59
|
+
5: string;
|
|
60
|
+
6: string;
|
|
61
|
+
7: string;
|
|
62
|
+
8: string;
|
|
63
|
+
9: string;
|
|
64
|
+
};
|
|
65
|
+
thousands: {
|
|
66
|
+
1: string[];
|
|
67
|
+
2: string[];
|
|
68
|
+
3: string[];
|
|
69
|
+
4: string[];
|
|
70
|
+
5: string[];
|
|
71
|
+
6: string[];
|
|
72
|
+
7: string[];
|
|
73
|
+
8: string[];
|
|
74
|
+
9: string[];
|
|
75
|
+
10: string[];
|
|
76
|
+
};
|
|
10
77
|
}
|
|
11
78
|
import { N2WordsRU } from './ru.js';
|
package/lib/i18n/uk.js
CHANGED
|
@@ -86,10 +86,10 @@ export class N2WordsUK extends N2WordsRU {
|
|
|
86
86
|
/**
|
|
87
87
|
* Converts a value to cardinal (written) form.
|
|
88
88
|
* @param {number|string} value Number to be convert.
|
|
89
|
-
* @param {object} options Options for class.
|
|
89
|
+
* @param {object} [options] Options for class.
|
|
90
90
|
* @throws {Error} Value cannot be invalid.
|
|
91
91
|
* @returns {string} Value in cardinal (written) format.
|
|
92
92
|
*/
|
|
93
|
-
export default function (value, options) {
|
|
93
|
+
export default function (value, options = {}) {
|
|
94
94
|
return new N2WordsUK(options).floatToCardinal(value);
|
|
95
95
|
}
|
package/lib/i18n/vi.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a value to cardinal (written) form.
|
|
3
3
|
* @param {number|string} value Number to be convert.
|
|
4
|
-
* @param {object} options Options for class.
|
|
4
|
+
* @param {object} [options] Options for class.
|
|
5
5
|
* @throws {Error} Value cannot be invalid.
|
|
6
6
|
* @returns {string} Value in cardinal (written) format.
|
|
7
7
|
*/
|
|
8
|
-
export default function _default(value: number | string, options
|
|
8
|
+
export default function _default(value: number | string, options?: object): string;
|
|
9
9
|
export class N2WordsID extends AbstractLanguage {
|
|
10
10
|
constructor(options: any);
|
|
11
11
|
base: {
|
package/lib/i18n/vi.js
CHANGED
|
@@ -146,10 +146,10 @@ export class N2WordsID extends AbstractLanguage {
|
|
|
146
146
|
/**
|
|
147
147
|
* Converts a value to cardinal (written) form.
|
|
148
148
|
* @param {number|string} value Number to be convert.
|
|
149
|
-
* @param {object} options Options for class.
|
|
149
|
+
* @param {object} [options] Options for class.
|
|
150
150
|
* @throws {Error} Value cannot be invalid.
|
|
151
151
|
* @returns {string} Value in cardinal (written) format.
|
|
152
152
|
*/
|
|
153
|
-
export default function (value, options) {
|
|
153
|
+
export default function (value, options = {}) {
|
|
154
154
|
return new N2WordsID(options).floatToCardinal(value);
|
|
155
155
|
}
|
package/lib/i18n/zh.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a value to cardinal (written) form.
|
|
3
3
|
* @param {number|string} value Number to be convert.
|
|
4
|
-
* @param {object} options Options for class.
|
|
4
|
+
* @param {object} [options] Options for class.
|
|
5
5
|
* @throws {Error} Value cannot be invalid.
|
|
6
6
|
* @returns {string} Value in cardinal (written) format.
|
|
7
7
|
*/
|
|
8
|
-
export default function _default(value: number | string, options
|
|
8
|
+
export default function _default(value: number | string, options?: object): string;
|
|
9
9
|
export class N2WordsZH extends BaseLanguage {
|
|
10
10
|
constructor(options: any);
|
|
11
11
|
merge(lPair: any, rPair: any): {
|
package/lib/i18n/zh.js
CHANGED
|
@@ -69,10 +69,10 @@ export class N2WordsZH extends BaseLanguage {
|
|
|
69
69
|
/**
|
|
70
70
|
* Converts a value to cardinal (written) form.
|
|
71
71
|
* @param {number|string} value Number to be convert.
|
|
72
|
-
* @param {object} options Options for class.
|
|
72
|
+
* @param {object} [options] Options for class.
|
|
73
73
|
* @throws {Error} Value cannot be invalid.
|
|
74
74
|
* @returns {string} Value in cardinal (written) format.
|
|
75
75
|
*/
|
|
76
|
-
export default function (value, options) {
|
|
76
|
+
export default function (value, options = {}) {
|
|
77
77
|
return new N2WordsZH(options).floatToCardinal(value);
|
|
78
78
|
}
|