Skip to content

Instantly share code, notes, and snippets.

@kevin-brown
Created December 16, 2014 01:13
Show Gist options
  • Save kevin-brown/04038cddf619fd705cae to your computer and use it in GitHub Desktop.
Save kevin-brown/04038cddf619fd705cae to your computer and use it in GitHub Desktop.
Croation pluralization rules - New method for "character"
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;
}
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