Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to format NUMBER(8,4) to '0000.0000' output??
mRangel wrote:
> Well, nvl(to_char(COLA, '0000.0000'),' ') does the trick. Why
> do you need the LPAD ?
>
> system_at_TREINA01> create table besta ( numero number(8,4) );
>
> Table created.
>
> system_at_TREINA01> insert into besta values (1973.234);
>
> 1 row created.
>
> system_at_TREINA01> select to_char(numero,'0000.0000') from besta;
>
> TO_CHAR(NUMERO,'0000.0000')
> ---------------------------------------------------------------
> 1973.2340
Strange! But not on my machine (Oracle 9i R2) it does not work. Maybe
your number is not as mine? Try to use a number with 4 decimal places
AFTER decimal point.
e.g. 0.2345
Anyways, I found the solution. I simply added 'fm' to teh format description:
'fm0000.0000'
and voila, it worked!! Received on Wed Sep 06 2006 - 18:28:23 CDT
![]() |
![]() |