cancel
Showing results for 
Search instead for 
Did you mean: 

Help making numbers right-aligned on the same line as left-aligned text

Former Member
0 Kudos

Hey all,

I have a SAPscript for an invoice that prints several lines with text at the start and numbers at the end, like line items. Currently they print like this:


Text one                      123.45
Text two                       678.90
Text three                   123.21

I need the rightmost decimal place of the numbers to line up. Right now I have them separated from the text by using tabs, but that will only align the leftmost digit, not the rightmost. I've tried adding (R) to the numbers in the form code, but they still print the same way. Is it possible to have left-aligned and right-aligned text on the same line, and if so, how? I guess I could put the numbers into their own window to right-align them, but since this is in the main window I don't want to risk removing any info from it that might later be necessary in multi-page invoices.

How can I align the numbers properly?

Thanks,

Pedro

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In the paragraph format, make the allignment "decimal".

This is in the SAPScript, not the text element.

If you try to make it right justified, you will run into problems with things like trailing minus signs. You really want it alligned on the decimal, so that's the way you should do it.

Rob

Edited by: Rob Burbank on Aug 25, 2010 5:53 PM

Former Member
0 Kudos

Keshav, unfortunately that doesn't work. I'm not sure why. It does strike me as odd to specify a single variable as right-aligned in a left-aligned line, but I tried it and it has no effect.

Rob, I created a new paragraph format, gave it the same font as the one I'm currently using to print the lines, and gave it just one tab with a long width under the Paragraph Formats -> Tabs section. Now I'm using that paragraph format in my main window, and the code in the window looks like this:

&text&,,&number&

And the output looks like this:


Text one       1234.56
Text two        123.45
Text three     1234.56

Thanks!

Answers (1)

Answers (1)

kesavadas_thekkillath
Active Contributor
0 Kudos

Does the complete line holds both the data or are you using individual fields ?

Former Member
0 Kudos

Keshav,

Each line has the following format in the code:

&text&,,,,,,&number&

kesavadas_thekkillath
Active Contributor
0 Kudos

&text(25)&,,,,,,&number(R)&

or

&text&,,,,,,&number(R)&

Try this