|
-
One space on the left is the sign. If you try to convert negative number with to_char function you will see the minus sign rather than space.
select 'FORMAT: 000g000d00 PLUS ', to_char(23000.4, '000G000D00') from dual
union
select 'FORMAT: 000g000d00 MINUS ',to_char(-23000.4, '000G000D00') from dual
union
select 'FORMAT: S000g000d00 PLUS SIGN ',to_char(23000.4, 'S000G000D00') from dual
union
select 'FORMAT: S000g000d00 MINUS SIGN',to_char(-23000.4, 'S000G000D00') from dual
RESULT :
FORMAT: 000g000d00 MINUS -023.000,40
FORMAT: 000g000d00 PLUS 023.000,40
FORMAT: S000g000d00 MINUS SIGN -023.000,40
FORMAT: S000g000d00 PLUS SIGN +023.000,40
To avoid the space you can try the 'FM'
select to_char( 2000,'FM000g000d00') from dual;
( try this with negative number)
I hope this will help you.
Ao.
Aleš
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|