numd
Pluralize a word
- 1 dollar, 5 dollars
- 1 рубль, 2 рубля, 5 рублей
Install
npm install --save numd
Usage
; ; // 2 dollars; // 14 рублей
API
numd([num, ]word[, singular], plural)
Return a string if num
is defined:
; // 1 dollar; // 1 рубль
otherwise return a function:
const rur = ;; // 4 рубля; // 51 рубль
num
Type: number
Count to determine a word.
word
Type: string
Word in the nominative singular.
singular
Type: string
Word in the genitive singular, not used for English words and some other languages.
plural
Type: string
Word in the plural/genitive plural.
License
MIT