There was the following problem. Need a function to round the number to hundredths in a big way. Initially, the function was as follows:
function round_up($value, $precision) { $pow = pow ( 10, $precision ); return ceil($value * $pow) / $pow; } but there was a problem when passing the next round_up(740*0.006,2) value to the round_up(740*0.006,2) it gives 4.45 instead of 4.44. Further, the function is corrected in the following form:
function round_up ( $value, $precision ) { $pow = pow ( 10, $precision ); return ceil(round($value * $pow,2)) / $pow; } solved the previous problem, but a new one also arose when passing to the function of the next value:
round_up(3208.34*0.006,2) it gives out 19.25 instead of 19.26. Who can already faced it? Thanks a lot in advance!!!
number_format()function. - etki 2:51 pm