|
-
Jun 30th, 2006, 12:50 PM
#1
Thread Starter
Junior Member
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???
-
Jun 30th, 2006, 12:54 PM
#2
Re: How to code 1.5 percent
VB Code:
'Constant with a value of 1.5%
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 
-
Jun 30th, 2006, 01:05 PM
#3
Thread Starter
Junior Member
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.
-
Jun 30th, 2006, 01:08 PM
#4
Addicted Member
Re: How to code 1.5 percent
Also, something like..
VB Code:
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.
-
Jun 30th, 2006, 01:11 PM
#5
Thread Starter
Junior Member
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")
-
Jun 30th, 2006, 01:15 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|