Answer the question
In order to leave comments, you need to log in
How to make the spelling correct ending of the word?
For example, I have the text "3 screenshots"
How to make the ending of the word "Screenshot" change spelling correctly depending on the number?
For example "1 Screen Shot " / " 6 Screenshots " and so on.
Answer the question
In order to leave comments, you need to log in
Function for Russian language:
function pluralizeRus(n, forms) {
return n % 10 == 1 && n % 100 != 11
? forms[0]
: (n % 10 >= 2 && n % 10 <= 4
&& (n % 100 < 10
|| n % 100 >= 20) ? forms[1] : forms[2]);
}
alert('6 Скриншот' + pluralizeRus(6, ['', 'а', 'ов']));
This is called declination. Googled for "Declination in js"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question