RE: Exponential puzzler
Date: Mon, 27 Feb 2012 16:32:47 -0000
Thanks for all the responses folks, it would appear I misinterpreted the requirements and they merely wanted to take the text version and put it into a number column so to_number is absolutely fine J
From: Stephane Faroult [mailto:sfaroult_at_roughsea.com]
Sent: 27 February 2012 13:38
To: Robertson Lee - lerobe
Subject: Re: Exponential puzzler
On 02/27/2012 02:06 PM, Robertson Lee - lerobe wrote:
Anyone had to convert an exponential number to a proper decimal number ?
Ive got a varchar2 field which holds an exponential number as a string and need to get it out as a real number....
select popularity from lee1;
I would have thought a simple
select to_number(popularity) from lee1;
would work but it returns exactly the same.
I know I can format it in SQL*Plus but this is actually part of an application and I need to update a table with the numeric value of the exponential string.
Don't mistake the representation and the actual value. Once you have applied "to_number()", it has become a number, and therefore you have what you need for your update. If you want to *show* it differently, then it's a pure formatting (and conversion to varchar2) question. It's exactly the same story as with dates - even if a date doesn't display the way you want, it doesn't mean that inside Oracle it's not what it should be.
The exponential notation is just the best way to maximize the information displayed while minimizing the number of digits ...
The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged.
If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please resend this communication to the sender and delete the original message or any copy of it from your computer system.
http://www.freelists.org/webpage/oracle-l Received on Mon Feb 27 2012 - 10:32:47 CST