In the following code, why does $final returns value as float?
When the calculated value is 6, it should return as integer, otherwise float.
How can I do that?
$x = 62;
$round = 5 * round($x / 5);
$final = $round/10;
var_dump($final);
float(6)
Edit: Sorry if my question is not clear. I need to find out if the $final has any decimal value or not. So in order to find out that, I was using is_float function, but that always returns true because above variable returns the value in float always. Hope my question is a bit more clear.
intvalafterwards though.(if intval($final) == $final)...intval($final)that), otherwise gotfloat... where is the problem?