note 16308 deleted from function.intval by jimw

From: Date: Wed, 24 Oct 2001 20:43:58 +0000
Subject: note 16308 deleted from function.intval by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19398@lists.php.net to get a copy of this message
wls@wwco.com wrote: > If you want rounding.... > $result = intval( round( $value + 0.5 ) ); But that is not correct, because round() adds the 0.5 for you. Either of the following would work: $result = intval( $value + 0.5 ); $result = intval( round( $value ) );

« previous php.notes (#19398) next »