To get the percent of a number, you multiply it by the percentage value with the decimal two places to the left. So ten percent of 60 = 60 * 0.10.

So just get your input, set the var to: var +=...