Ramnarayan
Programmer
Hi,
I need to write a script to convert numbers to their ordinal form. AN example is given below:
1: 1st
2: 2nd
3: 3rd
4: 4th
5: 5th
6: 6th
7: 7th
8: 8th
9: 9th
0: 0th
For example
3: 3rd
22: 22nd
517: 517th
60: 60th
19993: 19993rd
I searched on the CPAN and could not find any Modules which can facilitate the conversion. I am at a lost on what logic is being used for this. Any useful scripts to generate the output will be greatly appreciated.
I need to write a script to convert numbers to their ordinal form. AN example is given below:
1: 1st
2: 2nd
3: 3rd
4: 4th
5: 5th
6: 6th
7: 7th
8: 8th
9: 9th
0: 0th
For example
3: 3rd
22: 22nd
517: 517th
60: 60th
19993: 19993rd
I searched on the CPAN and could not find any Modules which can facilitate the conversion. I am at a lost on what logic is being used for this. Any useful scripts to generate the output will be greatly appreciated.