Created
October 4, 2011 19:34
-
Star
(329)
You must be signed in to star a gist -
Fork
(73)
You must be signed in to fork a gist
-
-
Save realmyst/1262561 to your computer and use it in GitHub Desktop.
Revisions
-
realmyst created this gist
Oct 4, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ function declOfNum(number, titles) { cases = [2, 0, 1, 1, 1, 2]; return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; } use: declOfNum(count, ['найдена', 'найдено', 'найдены']);