Results 1 to 5 of 5

Thread: How do i make it to % it.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Devon, UK
    Posts
    311

    How do i make it to % it.

    how do i make mt textbox display a percentage of a text value?

    say i have a database (flexgrid) i want a text box to display a 75% of a col value, a numeric value.

    example code.

    msflexgrid1.col = 2
    text1.text = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2)

    Ok that puts up the current number value of col 2 and selected row into the textbox.

    but how do i make it only 75% of that value. i tried:

    msflexgrid1.col = 2
    text1.text = 75% of (MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2))

    but it didn't work.

    Please help me.
    Sam.

  2. #2
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    Try:

    VB Code:
    1. Text1.Text = .75 * (MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2))
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Devon, UK
    Posts
    311
    kool thanks mate that worked.
    Sam.

  4. #4
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    any time
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  5. #5
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441
    Originally posted by Mc Brain
    Try:

    VB Code:
    1. Text1.Text = .75 * (MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2))
    I would do it this way :

    VB Code:
    1. Text1.Text = round(.75 * cdbl((MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 2))),2)

    This is just my preference...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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