e991e2b61e84e28d4b3e3fa95a06261bd4b03223
[platform/framework/web/crosswalk-tizen.git] /
1 define(function () {
2
3     /**
4      * Returns "nth" of number (1 = "st", 2 = "nd", 3 = "rd", 4..10 = "th", ...)
5      */
6     function nth(i) {
7         var t = (i % 100);
8         if (t >= 10 && t <= 20) {
9             return 'th';
10         }
11         switch(i % 10) {
12             case 1:
13                 return 'st';
14             case 2:
15                 return 'nd';
16             case 3:
17                 return 'rd';
18             default:
19                 return 'th';
20         }
21     }
22
23     return nth;
24
25 });