Russian noun agreement after a number is famously tricky: the same noun changes shape depending on the count. This helper applies the standard 1-2-5 rule so you always get один рубль, два рубля, пять рублей right — for any noun and any number.
How it works
Russian selects one of three forms from the last two digits of the count:
ends in 1, but not 11 -> ONE (nominative singular) 1 рубль, 21 рубль
ends in 2-4, but not 12-14 -> FEW (genitive singular) 2 рубля, 23 рубля
everything else -> MANY (genitive plural) 5 рублей, 11 рублей, 0 рублей
In code the test is n % 10 == 1 && n % 100 != 11 for ONE,
n % 10 in 2 to 4 and n % 100 outside 12 to 14 for FEW, and MANY otherwise.
The teens 11 to 14 are the trap — they always take MANY despite their final digit.
Example
For рубль (forms рубль / рубля / рублей):
- 1 рубль, 2 рубля, 5 рублей
- 21 рубль, 22 рубля, 25 рублей
- 11 рублей, 12 рублей, 14 рублей (teens always MANY)
- 101 рубль, 102 рубля (last two digits 01 and 02)
Tips
Always supply the genitive singular and genitive plural correctly — they are often different stems (год / года / лет). Some nouns have an irregular MANY form (человек after numbers becomes человек, not людей). The preset list covers the most common everyday nouns; for anything else, copy the three forms from a dictionary and the tool handles the agreement automatically.