Hi All,
Im building a bar graph from a results set supplied via load vars object.
I sometimes experience a miss calculation when certain odd numbers occur.
E.G I have 3 bars and 3 votes… bar1=1, bar2=1, bar2=1. My percent says 33% for each bar which totals to 99%. (or 33.3333 without rounding)
On other other occasions i get a total 101%
Im using the following code to work out percent for each bar.
var barPercent = Math.round((barVotes/this.totalVotes)*100)+"%"
Would i better swaping out the Math.round for another math function.
any ideas?