I cannot get the round() function to work correctly. Here’s what I’m currently doing:
if ($con2 == "sf") {
$formula = $num * 0.00694444;
$formula = round($formula);
$result = $num . $si . "<br>RESULT: " . $formula . $sf;
};
With this code, when $num is 144, the result is 0.99999936. However, I need that to be rounded to 1. Why is this happening and how can I get round() to behave the way I expect it to instead of this counter-intuitive way?
Okay – so could you try this script and see what happens, this is working the with behaviour you’re looking for when I enter 144: