Created
October 12, 2016 18:53
-
-
Save mikeriley131/4d0455181a77d08132c75e5e71b166a2 to your computer and use it in GitHub Desktop.
number ordinal indicator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (place.toString().substr(-1) === '1' && place !== 11) { | |
place = place + 'st' | |
} | |
else if (place.toString().substr(-1) === '2' && place !== 12) { | |
place = place + 'nd' | |
} | |
else if (place.toString().substr(-1) === '3' && place !== 13) { | |
place = place + 'rd' | |
} | |
else { | |
place = place + 'th' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment