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
I used the following to determine whether a returned value has any decimals (actual decimal values, not just formatted to display decimals like 100.00):
if($mynum - floor($mynum)>0) {has decimals;} else {no decimals;}