Fixing stupid calculation error.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user