Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199908

Re: [PHP3] Reg exp? From: Teodor Cimpoesu (teo <email protected>)
Date: 08/30/99

NHB Internet Services wrote:
>
> > $num = '40.123498710';
> > number_format($num, 2);
>
> If I have 39.99511235 it rounds it up to 40.
> How do I just drop the extra numbers, but not affect the actual value?

least printf("%.2f",$num); does this, there must me other.

--
CIMPOESU Teodor, Web Programmer (h)
@ DIGICOM S.A. Bucharest, Romania
@ Internet, site development
@ teo <email protected>, +(401)-330.47.28
 
official home page ~ http://www.digiro.net/
Internet web  page ~ http://internet.digiro.net/

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>