Percentage

1. Senior Member
Join Date
Dec 1969
Posts
2,880

## Percentage

How do I or what is the best way to calculate the sum value of a percentage e.g. 35% of 10 and I would get 3.50 and the total would be 10 + 3.50. How can I do so in ASP in the quickest way possible?<BR><BR>Thanks!

2. Senior Member
Join Date
Dec 1969
Posts
1,407

## RE: Percentage

you have two variables. the percentage(x) and the number(y).<BR><BR>dim value<BR>function whatever(x,y)<BR> value = y + (xy)<BR> return value<BR>end function<BR><BR>

3. Senior Member
Join Date
Dec 1969
Posts
380

## RE: Percentage

another attempt...<BR><BR>x=startvalue<BR>y=percentage<BR> <BR>x=x+(x*y/100)<BR><BR>or<BR><BR>x=x+((x*y)/100) to play safe

4. Senior Member
Join Date
Dec 1969
Posts
1,407

## RE: Percentage

be sure to check whether or not your percentage is already in percentage form. you won&#039;t want to divide by 100 if your percentage is already in .xx format.

5. Senior Member
Join Date
Dec 1969
Posts
380

## RE: Percentage

right, but i was expecting that he would feed the routine with a proper value (1-100) ;)

#### Posting Permissions

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