round php decimal value to second digit after last 0
问题 I have results of an "on the fly" calculation that end in decimal values (after converted using money_format) as follows: $cost_per_trans = 0.0000000476 $cost_per_trans = 0.0000007047 The corresponding values before the money_format are: 4.7564687975647E-8 7.0466204408366E-7 These values may be of different lengths but I would like to be able to round them to the last 2 digits after the string of "0s", to get this for example: $cost_per_trans = 0.000000048 $cost_per_trans = 0.00000070 I am