Is there a straightforward way of determining the number of decimal places in a(n) integer/double value in PHP? (that is, without using explode)
explode
You could try casting it to an int, subtracting that from your number and then counting what's left.