Question :
How do I convert an exponential number (NUMBER) to string (VARCHAR) but which is expressed equal to?
Example:
SQL> SELECT TO_CHAR (NUMERO) NUMCONVERT
2 FROM (SELECT 3E4 NUMERO FROM DUAL);
NUMCONVERT
----------------------------------------
30000
How to return ‘3E4’ ??
Answer :
Using only TO_CHAR(numero,'FM9.9EEEE')
, returns:
3.E + 04
But since you want me to stay the same way, I did a Gambiarra :
SELECT REPLACE(
REPLACE(
REPLACE(TO_CHAR(numero,'FM9.9EEEE'),
'E+0','e')
,'E+','e')
,'.','') numconvert
FROM (SELECT 3e4 as numero
FROM dual);
Returning:
3e4
I hope it helps.