Calculating a percentage, is there a more optimised way?
<pre><code>var q3a1 = parseInt(valueOne); //get variables
var q3a2 = parseInt(valueTwo);
var q3a3 = parseInt(valueThree);

var totalAmountThree = Math.ceil((q3a1+q3a2+q3a3) / 100)*100; //round to nearest 100

var percentOnec = ((q3a1 / totalAmountThree) * 100); //calculate percentage
var percentTwoc = ((q3a2 / totalAmountThree) * 100);
var percentThreec = ((q3a3 / totalAmountThree) * 100);

alert("1: "+percentOnec);
alert("2: "+percentTwoc);
alert("3: "+percentThreec);
</code></pre>

<p>Is there a better way for me to be calculating a percentage?</p>

<p>(Fiddle with me: <a href="http://jsfiddle.net/neuroflux/Sez3Q/" rel="nofollow">http://jsfiddle.net/neuroflux/Sez3Q/</a>)</p>
