How to format all numbers in a code has been shown here. I have adapted it to include it in a language definition:
\documentclass[fleqn, a4paper]{article}
\usepackage{listings}
\usepackage{color}
\lstdefinelanguage{mylang}{%
basicstyle=\ttfamily,%
literate={0}\textcolor{blue}{0}}{1}%
{1}\textcolor{blue}{1}{1}%
{2}\textcolor{blue}{2}{1}%
{3}\textcolor{blue}{3}{1}%
{4}\textcolor{blue}{4}{1}%
{5}\textcolor{blue}{5}{1}%
{6}\textcolor{blue}{6}{1}%
{7}\textcolor{blue}{7}{1}%
{8}\textcolor{blue}{8}{1}%
{9}\textcolor{blue}{9}{1}%
{.0}\textcolor{blue}{.0}{1}% Following is to ensure that only periods
{.1}\textcolor{blue}{.1}{1}% followed by a digit are changed.
{.2}\textcolor{blue}{.2}{1}%
{.3}\textcolor{blue}{.3}{1}%
{.4}\textcolor{blue}{.4}{1}%
{.5}\textcolor{blue}{.5}{1}%
{.6}\textcolor{blue}{.6}{1}%
{.7}\textcolor{blue}{.7}{1}%
{.8}\textcolor{blue}{.8}{1}%
{.9}\textcolor{blue}{.9}{1}%
{\ }{ }{1}% handle the space
,
}
\begin{document}
\begin{lstlisting}[language=mylang]
{
_SetCalibTableName("lorem",100);
}
\end{lstlisting}
\end{document}
The following error is produced:
! Argument of \lst@FillFixed@ has an extra }.
It looks as if it would not like my single {
and }
?
How to include it properly?