Results 1 to 6 of 6

Thread: How to code 1.5 percent

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    16

    How to code 1.5 percent

    I'm coding a program and need to find out how to assing 1.5 percent to a constant.
    I know the following but I guess I'm getting confused on how to write 1.5 precent so if
    1%(0.??) 1.5%(?.??)
    10% (0.10)
    25% (0.25)
    90% (0.90)

    how do I write it???

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: How to code 1.5 percent

    VB Code:
    1. 'Constant with a value of 1.5%
    2. Const dYourPercent As Double = 0.015
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    16

    Re: How to code 1.5 percent

    Ah...Thanks DKenny would 1.75% be

    Const dYourPercent As Double = 0.0175 ???? Or how about 1/10 of a percent???
    Last edited by 93octane; Jun 30th, 2006 at 01:14 PM.

  4. #4
    Addicted Member
    Join Date
    Jun 2006
    Posts
    172

    Re: How to code 1.5 percent

    Also, something like..

    VB Code:
    1. Text1.Text = Format(0.01, "Percent")

    You can just swap out 0.01 with a double variable, and it will format it by multiplying by 100, and adding the percent sign to the right of the number.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2006
    Posts
    16

    Re: How to code 1.5 percent

    Well the percent won't be entered in a text box it will be a constant...
    Text1.Text = Format(0.01, "Percent")

  6. #6
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: How to code 1.5 percent

    Ah...Thanks DKenny would 1.75% be

    Const dYourPercent As Double = 0.0175 ????
    That is correct
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

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