note 10014 added to is_float
| From: | warpkat2001 at yahoo dot com | Date: | Thu, 07 Dec 2000 02:40:05 +0000 |
| Subject: | note 10014 added to is_float | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8492@lists.php.net to get a copy of this message | ||
This is useful if you are creating a report page (like detailed ledgers for finance) for alternating
colors in tables:
$myVar = 0;
for ($x = 0, $x < 32; ++$x){
$checkme = $myVar / 2;
if(is_float($checkme)){
$my_color = "black";
} else {
$my_color = "white";
}
$myVar = $myVar + 1;
}
If the division by 2 of your $myVar has a decimal value associated with it, it will flag it as a
float integer rather than a rounded number.
http://www.php.net/manual/function.is-float.php