You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each language has it's own unique grammar exceptions. You can create your own language.json file in the folder "i18n" and give writtenNumber support for it. I don't think the current scheme and logic cover all the cases, but may be cover some.
71
+
Each language has it's own unique grammar exceptions. You can create your own
72
+
language.json file in the folder "i18n" and give writtenNumber support for it. I
73
+
don't think the current scheme and logic cover all the cases, but may be cover
74
+
some.
69
75
70
76
##### useLongScale:
71
77
'Boolean' that indicates if it use [long or short scale](http://en.wikipedia.org/wiki/Long_and_short_scales). This differs the meaning of the words `billion`, `trillion` and so on.
Base cardinals numbers. Numbers that have unique names and are used to build others.
87
93
94
+
##### alternativeBase:
95
+
Alternative versions of base cardinals numbers for usage with specific units (ex. thousands in Ukrainian use feminine form of base cardinal numbers). These bases will be treated as an extension for the default `base`.
96
+
97
+
```json
98
+
"alternativeBase": {
99
+
"feminine": {
100
+
"1": "одна",
101
+
"2": "дві"
102
+
}
103
+
}
104
+
```
105
+
88
106
##### units:
89
107
Number units.
90
108
It can be:
@@ -96,10 +114,42 @@ It can be:
96
114
"plural": "millones"
97
115
}
98
116
```
117
+
118
+
- Object with `few` word form.
119
+
120
+
In some languages like Ukrainian, there are specific unit forms for values from 2 (including) to 4 (including). This forms can be specified with `few`.
121
+
122
+
```json
123
+
{
124
+
"singular": "мільйон",
125
+
"few": "мільйони",
126
+
"plural": "мільйонів",
127
+
...
128
+
}
129
+
```
130
+
131
+
- Object with `useAlternativeBase`.
132
+
133
+
Selects an `alternativeBase` name which this unit should prefer over the default `base` if possible.
134
+
135
+
```json
136
+
{
137
+
"singular": "тисяча",
138
+
"few": "тисячі",
139
+
"plural": "тисяч",
140
+
"useAlternativeBase": "feminine"
141
+
...
142
+
}
143
+
```
144
+
145
+
99
146
- Object with `useBaseInstead` exception.
147
+
100
148
In some languages like spanish and arabic, specific units like "ciento", use the base cardinal number instead.
149
+
101
150
- Object with `useBaseException`: You can also specify with which unit (1 to 9) you don't
102
151
want use the base cardinal instead and use the regular behaviour:
152
+
103
153
```json
104
154
{
105
155
"singular": "ciento",
@@ -129,6 +179,21 @@ numbers wioth trailing numbers other than 0, for example "deux cents" and "deux
129
179
- Object with `restrictedPlural` boolean:
130
180
If plural is used only for numbers from 3 to 10 , but the singular form is used if the number is older than 11.
131
181
182
+
- Object with `useSingularEnding` exception and `useFewEnding` exception.
183
+
184
+
In some languages like Ukrainian, singular form of the unit is also used for any values that end with 1 (21, 31, 14, ..., 101, ...) and "few" form of the unit is also used for any values that end with 2, 3 and 4 (22, 33, 44, ..., 104, ...). The `avoidEndingRules` exception provides values (1 to 999) where these rules must be ignored and the plural form must be used instead.
0 commit comments