Perhaps you may find useful the \uuline or even the \uwave commands in the ulem package. Put \usepackage{ulem} in the preamble and try these commands instead of your \ans command.
I'm afraid it didn't work properly. It returned 0250 with the double lines only under the first 0.
Juanjo wrote:
Perhaps you may find useful the \uuline or even the \uwave commands in the ulem package. Put \usepackage{ulem} in the preamble and try these commands instead of your \ans command.
are equivalent. I know that not using the brackets is a TeX syntax feature, but it doesn't cause any troubles in this case and even the LaTeX companion suggests this practice with \newcommand.