Dine eksempler viser to forskellige formater - et for decimaltal og et andet for heltal.
with sampledata as
(select 0.23 as rowa from dual
union all select 0.2350 from dual
union all select 0.1000 from dual
union all select 1.250 from dual
union all select 1200 from dual
union all select 1.300 from dual
)
select TO_CHAR(rowa
,CASE WHEN rowa = TRUNC(rowa)
then 'fm999999999999999990'
else 'fm999999999999999990D999'
end) as rowa
from sampledata;
ROWA
=====
0.23
0.235
0.1
1.25
1200
1.3