Created
January 5, 2021 20:51
-
-
Save Lokno/7c5730d37c9dfe291578dcde0502e0d7 to your computer and use it in GitHub Desktop.
AutoHotKey script that appends the correct suffix to an ordinal number
This file contains hidden or 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
| ^d:: | |
| Send {+Home} | |
| Send ^c | |
| Send {End} | |
| RegExMatch(clipboard, "(\d+)$", SubPat) | |
| StringRight, lastDigit, SubPat, 1 | |
| if( SubPat == "11" || SubPat == "12" || SubPat == "13" ) | |
| { | |
| Send, th | |
| } | |
| else if( lastDigit == "1" ) | |
| { | |
| Send, st | |
| } | |
| else if( lastDigit == "2" ) | |
| { | |
| Send, nd | |
| } | |
| else if( lastDigit == "3" ) | |
| { | |
| Send, rd | |
| } | |
| else | |
| { | |
| Send, th | |
| } | |
| return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment