Page 1 of 1

Difference

Posted: Mon Jun 16, 2008 3:28 am
by sandy1028
Hi,

Is there any way to differentiate between 0 and 0.00.

$a=0;
$b=0.00;

Code: Select all

In a function I have to assign color 
function FCallback($aVal) {
 
    if( $aVal == 0 ) $c = "red";
    elseif( $aVal == '0.00' ) $c = "black";
    else $c="green";
    return array(3,"",$c);
}
But if aVal is 0 and 0.00 same color is printed. Is there anyway to differentiate between the two.

Re: Difference

Posted: Mon Jun 16, 2008 3:31 am
by Ollie Saunders
is_float()
is_int()

Re: Difference

Posted: Mon Jun 16, 2008 8:29 am
by Ambush Commander
use ===