Code
\documentclass{article}
\newcommand*\test[2]{#1\textsuperscript{#2}}
\begin{document}
The player ended as no.~\test{1}{} and her friend came in \test{2}{nd}.
\end{document}
Output
Question
How can I change the \test command so that I'm abel to switch between one or two arguments?
(I would like to be abel to write \test{1} instead of \test{1}{}.)


\NewDocumentCommand;-) – Jan 17 '16 at 10:55\test{1}and\test{2}[nd]? – egreg Jan 17 '16 at 10:57fmtcount– Jan 17 '16 at 10:58\test{1}and\test{2}{nd}, but I'm recommending not to. – egreg Jan 17 '16 at 11:03{}arguments. A major aim of the system is to give a consistent interface to arguments. If an argument is optional it should be in square brackets. – David Carlisle Jan 17 '16 at 11:12