Similar to solutions in Visualization in LaTeX of hamming distance, and Problem with the alignment of characters, you could use the literate command to define a style that is to be applied to each digit. Below I included a color for the . but commented out the color for the ,.

As there might be a period used outside of a number context, I have defined different styles based on the assumption that any period used in a number will have a digit following it.
\documentclass[border=2pt]{standalone}
\usepackage{listings}
\usepackage{xcolor}
\lstdefinestyle{FormattedNumber}{%
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}%
%{,}{\textcolor{blue},}{1}% depends if you want the "," in color
{\ }{ }{1}% handle the space
,
basicstyle=\ttfamily,% Optional to use this
}
\newcommand{\FormattedNumber}[1]{%
\lstinline[style=FormattedNumber]{#1}%
}
\begin{document}
\FormattedNumber{a.vector([3/5,4,0.4566])}
\end{document}
\documentclassso that those trying to help don't have to recreate it. – Peter Grill Oct 20 '11 at 16:44