Created
December 16, 2014 01:13
-
-
Save kevin-brown/04038cddf619fd705cae to your computer and use it in GitHub Desktop.
Croation pluralization rules - New method for "character"
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 character (n) { | |
var message = ' ' + n + ' znak'; | |
if (n % 10 < 5 && n % 10 > 0 && (n % 100 < 5 || n % 100 > 19)) { | |
if (n % 10 > 1) { | |
message += 'a'; | |
} | |
} else { | |
message += 'ova'; | |
} | |
return message; | |
} |
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 character (n) { | |
return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment