RE: [PHP] Need unrounded precision

From: Date: Mon, 12 Oct 2009 16:18:06 +0000
Subject: RE: [PHP] Need unrounded precision
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-298866@lists.php.net to get a copy of this message
>> Couldn't this be done with just simple math functions? > >indeed: > >$a = 28.56018; >$b = $a * 10 % 10 >> 0; Hmmm... Didn't think about this, but % only works with int values, so $b = $a * 10 % 10; Should work as well. Jaime

« previous php.general (#298866) next »