sql – Why To_char(3E4) doesn't result in '3E4'?

Question:

Guys, how do I convert an exponential number (NUMBER) to string (VARCHAR) but that is expressed equal??

Example:

SQL> SELECT   TO_CHAR (NUMERO) NUMCONVERT
  2    FROM   (SELECT   3E4 NUMERO FROM DUAL);

NUMCONVERT
----------------------------------------
30000

How to return '3E4'??

Answer:

Try it this way:

TO_CHAR(number, '9.9EEEE')

Source: http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm

Scroll to Top
AllEscort