PHP: get number of decimal digits
$str = "1.23444";
print strlen(substr(strrchr($str, "."), 1));
Less code:
$str = "1.1234567";
echo (int) strpos(strrev($str), ".");
You could try casting it to an int, subtracting that from your number and then counting what's left.