math expression

1. Senior Member
Join Date
Dec 1969
Posts
1,229

## math expression

Plodding through something I have never had to do here.<BR><BR>I need to divide a variable and display the result as a percentage. 100% would be 13 out of 13. So I set the math like this:<BR><BR>cntr = cntr / 13<BR><BR>I get a correct decimal answer but I need a percent. A trip to the FAQ&#039;s didn&#039;t help. Anyone know how to code this?

2. mj
Senior Member
Join Date
Dec 1969
Posts
848

## RE: math expression

Dim MyPercent<BR>MyPercent = FormatPercent(cntr) &#039; MyPercent contains the percentage of your number.<BR><BR><BR>check out the VBScript Reference on the left side of this page<BR><BR><BR>mj

3. Senior Member
Join Date
Dec 1969
Posts
1,229

## Oops

Thank you! I was looking in the wrong place!

4. Senior Member
Join Date
Dec 1969
Posts
96,118

## Well...yes, but...a big but...

That only changes the VISIBLE appearance of the number from 0.83 to 83%. The number, per se, stays as 0.83.<BR><BR>If you need to do something *other* than just display the number, then you simply need to multiply the answer by 100. Nothing more. (I could tell you that my niece is learning this in 5th grade right now, but I wouldn&#039;t do that to you. Would I?)<BR><BR>

5. Senior Member
Join Date
Dec 1969
Posts
1,229

## LOL

Bill you crack me up! Yes all I needed to do was display the result as a percent. I never did do well in math after the 3rd grade but I did know that. By the way I guess I&#039;m really OLD. I remember LSMFT and I would also "Rather fight than switch" and remember the ones that were "a silly millimeter longer"? 101&#039;s. Getting older I&#039;m digressing now too. &#060;sigh&#062;

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•