Regex are very very not efficient in calculations, they are mean if you can go another way. So I would avoid them :)
Things like "Number % 1" return the rounded decimal value (2.3 % 1 = 0.2999999999999998), and in a general way I would advice you to use strings as early as possible, since approximations with real numbers can change the number of decimals.
So yours is fine, but I'll look a way to optimize it.
Edit:
function CountDecimalDigits(number)
{
var char_array = number.toString().split(""); // split every single char
var not_decimal = char_array.lastIndexOf(".");
return (not_decimal<0)?0:char_array.length - not_decimal;
}