Results 1 to 2 of 2

Thread: Aligning currency amounts when printing

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Calgary
    Posts
    6

    Post

    I am printing an invoice through Printer.Print commands. Is there an easy way to line up the .'s in a column of dollar values? I know I could create a function which would pad the variables(that hold the dollar values) so they are all the same length thus forcing dots to line up but is there a simpler way.
    My code goes like this:
    Printer.Print tab(32); format(sngDollarAmount1, "Currency")

    Printer.Print tab(32); format(sngDollarAmount2, "Currency")

    and output is like this:

    $100.00
    $10.00

    instead of what I would like:
    $100.00
    $ 10.00

    I tried to define my own formats. I know in COBOL there is a symbol for inserting leading spaces for output but is there one in VB 5? I tried @ but it created junk.
    Thanks


    [This message has been edited by Dean Murray (edited 02-09-2000).]

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    This will only work with fix fonts like Courier

    Printer.FontName = "Courier"
    Printer.Print Format(100, "@@@.00")
    Printer.Print Format(10, "@@@.00")



    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

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