code to convert 1,21,31to 1s,21st and 31st