C.R. Vegelin wrote:
Hi All,

Does anyone know how to use the format() function in such a way that is 
displays numbers right justified.
For example, see the following query, where I want no decimal places:
SELECT 123456.789 AS X, FORMAT(123456.789, 0), FORMAT(123456.789, 0)+0;
The 1st column is normally displayed as 123456.789
The 2nd column is displayed as string (left justified) as 123,457
BUT the 3rd column, using +0 to force right-justified, cuts off valid data and displays only 123

Hi Cor,

I would use the ROUND() function to do the rounding, as it returns values with the same type as the first argument.
http://dev.mysql.com/doc/mysql/en/mathematical-functions.html


Regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to