You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
338 B
17 lines
338 B
exports = function(num) {
|
|
var j = num % 10;
|
|
var k = num % 100;
|
|
var indicator = 'th';
|
|
if (j == 1 && k != 11) {
|
|
indicator = 'st';
|
|
}
|
|
if (j == 2 && k != 12) {
|
|
indicator = 'nd';
|
|
}
|
|
if (j == 3 && k != 13) {
|
|
indicator = 'rd';
|
|
}
|
|
return num + indicator;
|
|
};
|
|
|
|
module.exports = exports;
|
|
|