php float value
floatval ($var)
comparing floats php
// You cannot compare float values like you would compare intergers in PHP
// since a float is calculated and may not have the exact value as shown
// an easy way to get around this is to round the float, then convert the float
//to a string for the comparison
$a = 1.5;
$b = 1.5;
$a = round($a, 2);
$b = round($b, 2);
if (strval($a) === strval($b)) var_dump('it matches!');
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us