Results 1 to 4 of 4

Thread: Simple Printing Question, (I Think)

  1. #1

    Thread Starter
    Member JPRoy392's Avatar
    Join Date
    Aug 2000
    Posts
    50

    Question

    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.

    Jim

    "...head is all empty and I don't care..."

  2. #2

  3. #3

    Thread Starter
    Member JPRoy392's Avatar
    Join Date
    Aug 2000
    Posts
    50
    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.

    Jim

    "...head is all empty and I don't care..."

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width