-
Right Justify
I am using the utl_file package to create a file. I have a variable
v_amt char(200);
I want to make an amount a character and then put it into the above field.
v_amt := to_char(100);
Now I want this amount to be right justified with 197 spaces in front of it. It is coming out as 100 with 197 spaces after it. Is there a function to right justify a string??
-
-
The simplest is probably:
v_amt := lpad(to_char(100),200,' ');
Perhaps this could work (I've no idea if there is a limit on the size of a format model):
v_amt := to_char(100, '999 . . . 999');
where there are 199 9's. See: http://www.csee.umbc.edu/help/oracle.../ch2.htm#34597
Which begs the question - WHY?
-
Originally posted by DaPi
Which begs the question - WHY?
I've learned to not ask WHY? The answer is going to be something like "So it shows up on a report and the decimals line up" or "so it will sort in the right order"...
Jeff Hunter
-
Originally posted by marist89
The answer is going to be something like "So it shows up on a report ...
This should guarantee that it doesn't show up on the report - the least sig digits being about 60 postions to right of the RH margin!
-
except in legal landscape at Courier 2
Jeff Hunter
-
My IBM ruler goes from 1 to 132 - and as far as I'm concerned that is it!
Last edited by DaPi; 01-06-2004 at 10:11 AM.
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
|