- // Basically, it just allows you to represent a number or count in different ways
- // depending on the number... like, with count_ordinal you can provide integers
- // and retrieve 1st, 2nd, 3rd, nth ordinal numbers in a clean and simple way.
- if (floor((interval % 100) / 10) * 10 != 10) // examples: 12th, 111th, 213th will not execute this block
+ int last2digits = interval % 100;
+
+ // numbers ending with 11, 12 and 13 don't follow the standard pattern
+ if (last2digits < 4 || last2digits > 20)