I am wondering how in javascript if i was given a number (say 10000) and then was given a percentage (say 35.8%)
how would I work out how much that is (eg 3580)
This is what I would do:
// num is your number // amount is your percentage function per(num, amount){ return num*amount/100; } ... ... alert(per(10000, 35.8));