\documentclass{article}
\usepackage{tikz}

\newlength\szg
\newcommand\quan[1]{%
\settoheight\szg{#1}%
\tikz[baseline]{\pgfmathparse{
ifthenelse(#1 < 10, 1, ifthenelse(#1 < 100, 0.75, 0.5))
}
\let\hfs\pgfmathresult
\node at (0,\szg/2) {\makebox[0em][c]{\scalebox{\hfs}[1]{#1}}};
\draw (0,\szg/2) circle (\szg/2+0.35ex);
}}

\begin{document}

0\quan01\quan23\quan456\quan789\quan{10}11\quan{131}41\quan{77}18\quan{202}12\quan{22}3\quan{999}

\small
0\quan01\quan23\quan456\quan789\quan{10}11\quan{131}41\quan{77}18\quan{202}12\quan{22}3\quan{999}

\Huge
0\quan01\quan23\quan456\quan789\quan{10}11\quan{131}41\quan{77}18\quan{202}12\quan{22}3\quan{999}

\end{document}














