Created
May 7, 2016 05:19
-
-
Save cimmwolf/ec533dc145fff6e968e64309106165a1 to your computer and use it in GitHub Desktop.
Возвращает множественную форму слова
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function plural(n, forms) { | |
return forms[n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment