php - Floating number calculation -
this question has answer here:
i have 2 floats:
time1: 0.009925 time2: 0.01
when return time1 - time2
this:
difference -7.5e-5
time2 - time1
returns 7.5e-5 well.
how return normal float?
try number_format http://us3.php.net/number-format
echo number_format(0.009925 - 0.01,5); //-0.00008
Comments
Post a Comment