Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Function TO_CHAR
Hello,
The leading blank space is a place-holder for the sign (i.e. + or -), convention being that a positive number is implied if no implicit sign is shown.
If you specifically want to remove the leading space there are various options. One of the simplest is to precede your format mask with "fm" thus:
TO_CHAR(15,'fm0999') returns '0015') (at least in 9.2.0.4 it does!)
The other aspect to this is that if you want to force a sign to be shown, whether it is negative or positive, this can be done with:
TO_CHAR(15,'S0999') returns '+0015'
Regards,
Tim Kearsley
HBS Milton Keynes
"Petr Benes" <benes_at_epos.cd.cz> wrote in message news:<4189e1f4.0_at_10.140.56.22>...
> Hi
>
> Expression TO_CHAR(15) returns '15'. It is correct.
> Expression TO_CHAR(15,'0999') returns ' 0015' instead '0015'.
> Tested in version 10q as well as 7.3.4.
>
> Do you know why there is the blankspace?
>
> Thanks
Received on Thu Nov 04 2004 - 09:08:34 CST
![]() |
![]() |