Why is PHP outputting decimals with a -E -


i trying round decimal after subtraction:

$decimal = round(0.000300-0.000200,6); 

the out put want : 0.0001

but why -1.0e-4 appearing? know means, why displaying way? kind of php setting causing this?

because rounding! not giving format display number. if want display float number 6 digits after point should use php's number_format:

$decimal = round(0.000300-0.000200,6);  number_format($decimal,6); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -