On Tue, Apr 1, 2008 at 11:04 AM, Wolfgang Schuster
On Tue, Apr 1, 2008 at 10:49 AM, Wolfgang Schuster
wrote: On Tue, Apr 1, 2008 at 9:56 AM, Zhichu Chen
wrote: Yes, only I don't need that complex. I mean \chinesenumber{123} will give "one hundred and twenty-three" but all I want is "one two three." Besides, I don't like to copy such long codes since I really don't want to load font-chi.tex which gives weird spacing problems while typesetting Chinese along with English. Anyway, I'd love to learn something rather than to use something.
Thanks.
Another solution using \afterassignment. The number is now removed from the input but you have to use a if test, number tests did not work. \def\zhnumber#1% {\expandafter\dozhnumber#1\endzhnumber} \def\endzhnumber{\endzhnumber} \def\dozhnumber {\afterassignment\dodozhnumber\let\next= } \def\dodozhnumber {\ifx\next\endzhnumber\let\next\relax \else \if\next 0a\else \if\next 1b\else \if\next 2c\else \if\next 3d\else \if\next 4e\else \if\next 5f\else \if\next 6g\else \if\next 7h\else \if\next 8i\else \if\next 9j\relax \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \let\next\dozhnumber \fi\next} \starttext \zhnumber{01234} \zhnumber{\number\pageno} \stoptext Wolfgang