\documentclass[a4paper]{article}
\usepackage{amsmath}
\newcommand*{\price}[2][17.5]{\pounds #2 excl VAT @ #1\%}
\begin{document}
\setlength{\parindent}{0pt}
\price{100} \\
\price[20]{30}
\end{document}
Works perfectly fine.
For my purpose, is it possible to change it, so that \price{30}{20} works like \price[20]{30}. That is, I want the optional arguments to be after the first argument and uses {} brackets.
Thanks.
{}but then you can't really (well you can but you shouldn't) make the argument optional. With normal arguments\price 2 3is (due to basic tex rules) the same as\price{2}{3}so it is pretty odd to make\price{2} 3not the same as\price{2}{3}If you really want that use xparse and agargument, but it breaks all latex syntax rules. – David Carlisle Mar 05 '20 at 09:09\frac12for\frac{1}{2}if I understood you correctly. – CasperYC Mar 05 '20 at 09:13\fracor\price. You can intercept TeX's normal rules and search for an explicit mandatory{character but .... – David Carlisle Mar 05 '20 at 09:14