Change rating percentile to a decimal place precision.

pull/1352/head
Unihedron 2015-12-27 20:23:59 +08:00
parent b5fa431230
commit 17eef55573
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ final class JsonView(getLightUser: String => Option[LightUser]) {
"rank" -> rank,
"percentile" -> ratingDistribution.map { distrib =>
lila.user.Stat.percentile(distrib, user.perfs(stat.perfType).intRating) match {
case (under, sum) => Math.round(under * 100.0 / sum)
case (under, sum) => Math.round(under * 1000.0 / sum) / 10.0
}
},
"stat" -> stat.copy(playStreak = stat.playStreak.checkCurrent))

View File

@ -40,7 +40,7 @@ module.exports = {
return util.fMap(d.stat.playStreak.time, function(s) {
return [
m('h2', m('span', {
title: 'less than one hour between games'
title: lessThan
}, 'Max time spent playing')),
streaks(s, util.formatSeconds)
];