> mysql> SELECT CONCAT(LEFT(@v, 4), 'e', SUBSTRING_INDEX(@v, 'e', -1)) as v;
Nice job. The only problem now is that the result doesn't round properly. Edward Dudlik Becoming Digital www.becomingdigital.com ----- Original Message ----- From: "Don Read" <[EMAIL PROTECTED]> To: "Paula R. T. Coelho" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, 17 June, 2003 12:42 Subject: Re: format a scientific number On 16-Jun-2003 Paula R. T. Coelho wrote: > Hi, > > I can't format properly a double number in scientific style. The number > is > around 3e-32, so I need it in scientific format with 2 decimals. In a > usual > 'select' it comes in scientific format but with a large number of > decimals. > If I try to fix the number of decimals with round() or format() it > returns > just 0.00 (it looses the scientific format). > > What can I do to fix the number of decimals without loosing the > scientific > style? > <mondo hack alert> mysql> SELECT @v; +-------------+ | @v | +-------------+ | 1.35702e-28 | +-------------+ 1 row in set (0.00 sec) mysql> SELECT CONCAT(LEFT(@v, 4), 'e', SUBSTRING_INDEX(@v, 'e', -1)) as v; +----------+ | v | +----------+ | 1.35e-28 | +----------+ 1 row in set (0.00 sec) Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. (53kr33t w0rdz: sql table query) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]