Last active
November 14, 2017 13:58
-
-
Save davebrny/7cab642728f25ca5cad2b9611582a284 to your computer and use it in GitHub Desktop.
(autohotkey) - return or add a singular/plural suffix
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
sp(number, string="", suffix="s") { | |
if (string) | |
string := number " " string | |
if (number = 1) | |
return string . "" | |
else return string . suffix | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
examples:
ternary example:
(number=1?"":"s")