|
-
Dec 22nd, 2002, 01:10 PM
#1
Thread Starter
Member
Percentage
I'm sure this is pretty easy.....but i cant get round it
The user enters a number in an imput box, this number is the percentage of a total size they want.
For example, if the number entered was 10, and the total number was, say 350, alli would need to do is divide 350 by 10, getting 35. BUT......if the user inputs any other number, say 20, i wouldnt be able to divide by 20, instead i would need to divide by 5. See where i am coming from?
Basicall, i think i am asking how can i find x% of a number???
Is that what i am asking? i havent a clue lol
Anyone?
Thanks
Dave
-
Dec 22nd, 2002, 05:35 PM
#2
Addicted Member
100 / inputted number = number to divide by
so, if they enter 20 then
100 / 20 = 5
The reason it works for 10 is because
100 / 10 = 10
-
Dec 23rd, 2002, 05:59 AM
#3
Thread Starter
Member
Thanks, I knew it was an easy sum
Dave
-
Dec 23rd, 2002, 06:32 PM
#4
So Unbanned
I would suggest you do:
Percent/100*WholeVal
-
Dec 25th, 2002, 04:01 AM
#5
Fanatic Member
Ok
how can i find x% of a number???
As Digi was saying, x% of a number=
number * (x/100)
i.e. 20% of 50=
50 * (20/100)
= 1000/100 = 10
sql_lall 
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
|