Created
June 30, 2015 05:54
-
-
Save lemming/42f68faa773def944789 to your computer and use it in GitHub Desktop.
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 characters
function pluralize(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