Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String getZorZe(int count) {
- count = Math.abs(count);
- switch (count) {
- case 2:
- case 3:
- case 4:
- case 7:
- case 14:
- case 17:
- case 40:
- case 60:
- case 70:
- case 100:
- return "ze";
- case 0:
- case 200:
- return "z";
- }
- if (count > 100 && count < 200)
- return "ze";
- int firstDigit = firstDigit(count);
- // nevokalizujeme "tÅ"/13/30+ http://prirucka.ujc.cas.cz/?ref=111&id=770
- return (firstDigit == 2 || firstDigit == 4 || firstDigit == 7) ? "ze" : "z";
- }
- public static int firstDigit(int n) {
- while (n < -9 || 9 < n) n /= 10;
- return Math.abs(n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement