-
Percentage
I'm sure this is pretty easy.....but i cant get round it :confused:
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 :confused: how can i find x% of a number???
Is that what i am asking? i havent a clue :rolleyes: lol
Anyone?
Thanks
Dave
-
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
-
Thanks, I knew it was an easy sum :D
Dave
-
I would suggest you do:
Percent/100*WholeVal
-
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