note 1587 deleted from Floating point numbers by jeroen

From: Date: Wed, 23 May 2001 23:14:09 +0000
Subject: note 1587 deleted from Floating point numbers by jeroen
Groups: php.notes 
Request: Send a blank email to php-notes+get-14212@lists.php.net to get a copy of this message
That 'is what i DONT want! I found bcmod, bcdiv functions. My function is: <PRE> function yuvarla($nb) { if ( bcmod($nb,1000) < 500 ) { return (bcdiv($nb,1000,0) * 1000); } else { return (bcdiv($nb,1000,0) * 1000 + 1000); } } echo yuvarla(187562.245); </PRE> This is ok, for my usage. I wrote this to give an idea only. You can developed for your personel usage. Happy PHPing...

« previous php.notes (#14212) next »