I am having trouble with the is_int() and is_double() functions. The relevant
parts of the function I'm using are:
-------------------------------------------------------------------------------
function lookupProduct( $partNum, $serial )
{
print( "lookupProduct( $partNum, $serial )<BR>\n" );
print( "<CENTER>\n" );
printf( "\$partNum: %d does %sappear to be a number, and %sa double<BR>\n",
$partNum,
( is_numeric( $partNum ) ? "" : "not " ),
( is_double( $partNum ) ? "" : "not " )
);
printf( "\$serial: %d does %sappear to be a number, and %sa double<BR>\n",
$serial,
( is_numeric( $serial ) ? "" : "not " ),
( is_double( $serial ) ? "" : "not " )
);
}
-------------------------------------------------------------------------------
The function is called after a form submission from HTML. When I enter
12 14
I get:
-------------------------------------------------------------------------------
lookupProduct( 12, 14 )
$partNum: 12 does appear to be a number, and not a double
$serial: 14 does appear to be a number, and not a double
-------------------------------------------------------------------------------
When I enter
12.5 14.8
I get:
-------------------------------------------------------------------------------
lookupProduct( 12.5, 14.8 )
$partNum: 12 does appear to be a number, and not a double
$serial: 14 does appear to be a number, and not a double
-------------------------------------------------------------------------------
Why is the function is_double() failing? I have an analagous problem with the
is_int() function.
Thanks!
-Michael
--
In light of the terrorist attack on the U.S.:
They that give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety.
-- Benjamin Franklin, 1759
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]