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