Fixing stupid calculation error.

This commit is contained in:
marcins78@gmail.com
2012-07-11 10:19:36 +00:00
parent 403f435e00
commit 527e1dc64d
2 changed files with 6 additions and 3 deletions

View File

@@ -311,7 +311,7 @@ public class ServerResource extends AbstractResource {
entry.setAttribute("format", casualStatistic.getFormatName());
entry.setAttribute("wins", String.valueOf(casualStatistic.getWins()));
entry.setAttribute("losses", String.valueOf(casualStatistic.getLosses()));
entry.setAttribute("perc", percFormat.format(1f * casualStatistic.getWins() / casualStatistic.getLosses()));
entry.setAttribute("perc", percFormat.format(1f * casualStatistic.getWins() / (casualStatistic.getLosses() + casualStatistic.getWins())));
type.appendChild(entry);
}
}

View File

@@ -10,11 +10,14 @@ var PlayerStatsUI = Class.extend({
},
loadPlayerStats:function () {
this.communication.getPlayerStats(this.loadedPlayerStats);
var that = this;
this.communication.getPlayerStats(
function (xml) {
that.loadedPlayerStats(xml);
});
},
loadedPlayerStats:function (xml) {
var that = this;
log(xml);
var root = xml.documentElement;
if (root.tagName == 'playerStats') {