- var convertExitNumber = function(exitNum) {
- var j = exitNum % 10,
- k = exitNum % 100;
- if (j === 1 && k !== 11) {
- return exitNum + "st";
- }
- if (j === 2 && k !== 12) {
- return exitNum + "nd";
- }
- if (j === 3 && k !== 13) {
- return exitNum + "rd";
- }
- return exitNum + "th";
+ var numToWord = function(num) {
+ return ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth"][num-1];