Re: Numeric question

From: Date: Tue, 16 Nov 2004 22:00:50 +0000
Subject: Re: Numeric question
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-37306@lists.php.net to get a copy of this message
I am fairly confident that in this particular case the opinion(s) contained within this email would nicely coincide with those of St. Jude Children's Research Hospital. We live in a world full of geometry. Ignatius Reilly _________________________ ----- Original Message ----- From: "Norland, Martin" <Martin.Norland@STJUDE.ORG> To: <php-db@lists.php.net> Sent: 16 November 2004 22:21 Subject: RE: [PHP-DB] Numeric question > Just a quick question, I'm having to calculate some values from an existing database, > but on some of the results I get (For example) > 0.590666666667 > How can I limit the result to only 2 digits after the decimal point with PHP? > Thanks > Chris Let the manual guide you: http://www.php.net/round for example: echo round(1.95583, 2); // 1.96 - Martin Norland, Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#37306) next »