i am writing a class that does simple bcmath operations on numbers. tho i need to set the scale automatically throughout this so i need a way to determine how many significant digits a number has.
for small and simple numbers converting it to string and a simple explode and strlen would do the job but bigger numbers are converted into scientific form therefor i cant think of anything.
$test = 100000000000000.00000000000000001;
var_dump($test);
var_dump($test.'');