Based on J.Wright's answer I wanted to count the characters of an operation. Nevertheless the output of the code below is
16 12321 2
where instead of the bold number I expected to count the number of characters of the previous 12321. What am I doing wrong?
\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc}
\def\zCountDigits#1{%
\number\numexpr0\zCountDigitsAux#1\zCountDigitsEnd\relax
}
\def\zCountDigitsAux#1{%
\ifx\zCountDigitsEnd#1\else+1\expandafter\zCountDigitsAux\fi
}
\def\zCountDigitsEnd{\zCountDigitsEnd}
\begin{document}
\newcommand{\eval}[1]{\pgfmathparse{#1}\pgfmathresult}
% the result of the next is 16, as should
\zCountDigits{0123456789ABCDEF}
% the evaluation gives 12321
\eval{int(111*111)}
% but the counting the result gives 2, not five
\zCountDigits{\eval{int(111*111)}}
\end{document}

