PHP dropping decimals without rounding up
You need floor() in this way:
$rounded = floor($float*100)/100;
Or you cast to integer:
$rounded = 0.01 * (int)($float*100);
This way it will not be rounding up.
$float = 1.505;
echo sprintf("%.2f", $float);
//outputs 1.50
Use the PHP native function bcdiv
echo bcdiv(2.56789, 1, 2); // 2.56