ryansuitposungkono / openjs-grid

Automatically exported from code.google.com/p/openjs-grid
0 stars 0 forks source link

column average not working - Fix for grid.js file #81

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. The average for int columns was not showing properly
2.
3.

What is the expected output? What do you see instead?

if there were 20 items, it was dividing by a count of 19, 
and it was also dividing from the max not the total

What version of the product are you using? On what operating system?

Please provide any additional information below.

The fix is changing grid.js line 520 from:

        sum = Math.round(sum*100)/100;
        avg = Math.round((max/count)*100)/100;

to this 

        count = count+1;
        sum = Math.round(sum*100)/100;
        avg = Math.round((sum/count)*100)/100;

Original issue reported on code.google.com by david...@gmail.com on 23 Aug 2012 at 6:01