-
Is there a way to right justify the output to a printer. For example, I have an order printing out with the itemized amounts left justified so it looks like this:
Code:
Results:
Golf Clubs $900.00
Golf Balls $45.00
Golf Tees $1.99
I want:
Golf Clubs $900.00
Golf Balls $45.00
Golf Tees $1.99
Thank You.
-
Use a fixed font like Courier and the Format fuction.
-
I do use courier new Font, but what is the format function?
This is my code:
Code:
Printer.CurrentX = HorizontalMargin + 0.5
Printer.Print sItem;
Printer.CurrentX = HorizontalMargin + 15
Printer.Print iPrice
All of the amounts are lined up, only they are doing it at the dollar sign and not the last digit in the price. Thank you for the help, I will keep trying.
-
You can fool around with this[code]
Public Sub RightJustify(curValue As Currency)
Select Case curValue
Case Is < 1
Printer.Print " " & Format(curValue, "$0.00")
Case Is < 10
Printer.Print " " & Format(curValue, "$0.00")
Case Is < 100
Printer.Print " " & Format(curValue, "$0.00")
Case Is < 1000
Printer.Print " " & Format(curValue, "$0.00")
Case Is < 10000
Printer.Print " " & Format(curValue, "$0.00")
' Or if you want commas in the output
'Printer.Print " " & Format(curValue, "$0,000.00")
End Select
End Sub
[\code]
Usage:
RightJustify 0.45
RightJustify 1.23
RightJustify 12.34
RightJustify 123.45
RightJustify 1234.56
RightJustify 12345.67