Results 1 to 4 of 4

Thread: Formating the Caption of a label

  1. #1
    Kenny_Dee
    Guest

    Formating the Caption of a label

    Is there away to format the caption of a label as follows.

    I want to be able to put commas in a label that contains only numeric data. There is no text at all. Right now the label look like this "1000000" I would like to change it so it looks like this "1,000,000"

    Thanks

    Ken Devorak

  2. #2
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Hmm,
    as far as I know, its simply:

    Label1.caption = "1,000,000"

    Unless you really want a function that automatically formats
    the caption.

    If you do, I'll whip something up in a minute.
    Just say so.


    -Lou

  3. #3
    Kenny_Dee
    Guest

    I need it to do it auto.

    I did do the whole label.caption = 1,000,000 but when I do a calculation on it as follows I losse the commas.

    label.caption = label.caption + intXXX

  4. #4
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Sorry, I was a little busy.

    So, check out the format function.
    Heres an example:

    Label2.Caption = 1234567
    Label2.Caption = Format(Label2.Caption, "###,###,###,###,###")

    This ends up as 1,234,567 in Label2.

    -Hope this helps,
    -Lou

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