Re: [PHP-DB] Round a number

2003-10-03 Thread Ignatius Reilly
l Message - From: "Ignatius Reilly" <[EMAIL PROTECTED]> To: "DB list PHP" <[EMAIL PROTECTED]>; "Shaun" <[EMAIL PROTECTED]> Sent: Friday, October 03, 2003 5:27 PM Subject: Re: [PHP-DB] Round a number > SELECT > TRIM( TRA

RE: [PHP-DB] Round a number

2003-10-03 Thread Dillon, John
This should do it: http://www.mysql.com/doc/en/Miscellaneous_functions.html FORMAT(X,D) Formats the number X to a format like '#,###,###.##', rounded to D decimals, and returns the result as a string. If D is 0, the result will have no decimal point or fractional part: mysql> SELECT FORMAT(12332

Re: [PHP-DB] Round a number

2003-10-03 Thread Peter Beckman
On Fri, 3 Oct 2003, Shaun wrote: > I have a query that returns a number from culculation in my table. It > returns say 4.00, 8.75, 0.00, 12.50 etc. How can I get MySQL to return the > number without any zeros, i.e. 4, 8.75, 0, 12.5 etc? You can't in MySQL. At least not that I could figure out.

Re: [PHP-DB] Round a number

2003-10-03 Thread Ignatius Reilly
SELECT TRIM( TRAILING '.' FROM TRIM( TRAILING '0' FROM mycol ) ) Ignatius _ - Original Message - From: "Shaun" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 03, 2003 5:12 PM Subject: [PHP-DB] Round a number > Hi, > > I have a query that r

RE: [PHP-DB] Round a number

2003-10-03 Thread Gary . Every
Try the rtrim function in php Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 "Pay It Forward" mailto:[EMAIL PROTECTED] http://accessingram.com > -Original Message- > From: Shaun [mailto:[EMAIL PROTECTED] > Sent: Friday, October 03, 2003 10:12 AM > To: [EMAIL PROTE