I want to round up my variable if it's decimal larger than .3
and if it's lower or equal it will round down, for example if i have 1.34
it will round up to 2
, if i have 1.29
it will round down to 1
, and if i have 1.3
it will round down to 1
. I don't know how to do this precisely, right now i'm using the round basic function like this:
$weight = $weight/1000;
if($weight < 1) $weight = 1;
else $weight = round($weight, 0, PHP_ROUND_HALF_DOWN);