@@ -205,6 +205,9 @@ Gives the plural of a certain word.
205
205
206
206
``` kotlin
207
207
" test" .pluralize() = > " tests"
208
+
209
+ " test" .pluralize(Plurality .CouldBeEither ) = > " tests"
210
+ " tests" .pluralize(Plurality .CouldBeEither ) = > " tests"
208
211
```
209
212
210
213
### Extension method singularize for String objects
@@ -213,4 +216,46 @@ gives the singular of a certain word.
213
216
214
217
``` kotlin
215
218
" tests" .singularize() = > " test"
219
+
220
+ " test" .singularize(Plurality .CouldBeEither ) = > " test"
221
+ " tests" .singularize(Plurality .CouldBeEither ) = > " test"
222
+ ```
223
+
224
+ ## <a id =" numbertowords " >Number to words</a >
225
+
226
+ ### Extension method toWords for String objects
227
+
228
+ Gives the value in words.
229
+
230
+ ``` kotlin
231
+ 1 .toWords() = > " one"
232
+ 10 .toWords() = > " ten"
233
+ ```
234
+
235
+ ### Extension method toOrdinalWords for String objects
236
+
237
+ Gives the value in ordinal words.
238
+
239
+ ``` kotlin
240
+ 1 .toOrdinalWords() = > " first"
241
+ 10 .toOrdinalWords() = > " tenth"
242
+ ```
243
+
244
+ ## <a id =" toquantity " >To quantity</a >
245
+
246
+ ### Extension method toQuantity for String objects
247
+
248
+ ``` kotlin
249
+ " case" .toQuantity(1 ) = > " 1 case"
250
+ " cases" .toQuantity(1 ) = > " 1 case"
251
+ " case" .toQuantity(10 ) = > " 10 cases"
252
+
253
+ " cases" .toQuantity(1 , showAsQuantity = ShowQuantityAs .None ) = > " case"
254
+ " cases" .toQuantity(2 , showAsQuantity = ShowQuantityAs .None ) = > " cases"
255
+
256
+ " cases" .toQuantity(1 , showAsQuantity = ShowQuantityAs .Numeric ) = > " 1 case"
257
+ " cases" .toQuantity(2 , showAsQuantity = ShowQuantityAs .Numeric ) = > " 1 case"
258
+
259
+ " cases" .toQuantity(1 , showAsQuantity = ShowQuantityAs .Words ) = > " one case"
260
+ " cases" .toQuantity(2 , showAsQuantity = ShowQuantityAs .Words ) = > " two cases"
216
261
```
0 commit comments