Re: Numeric question
| From: | Joshua D. Drake | Date: | Tue, 16 Nov 2004 22:39:16 +0000 |
| Subject: | Re: Numeric question | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37308@lists.php.net to get a copy of this message | ||
Brent Baisley wrote:
round() rtfm.I would agree, rtfm is a good choice in this regard but the wrong rtfm. This is something that should be done IN the database not in PHP. If you are using PostgreSQL you can do this: select column::numeric(10,2) from foo; Sincerely, Joshua D. Drake
On Nov 16, 2004, at 3:38 PM, Chris Payne wrote:-- Command Prompt, Inc., home of PostgreSQL Replication, and plPHP. Postgresql support, programming shared hosting and dedicated hosting. +1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQLHi there everyone, 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 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.797 / Virus Database: 541 - Release Date: 11/15/2004