summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Users.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2012-01-10 15:44:32 +0100
committerYorhel <git@yorhel.nl>2012-01-10 15:44:32 +0100
commit7f48af30ed456688391e46b1a577c5907cdd7be7 (patch)
tree468dde27c392eab5af23e05e87f452a622c6316e /lib/VNDB/Handler/Users.pm
parent3ea8eef12df3e84645b59301211cd233b6c27a2d (diff)
Allow one fractional digit for VN votes
The interface to set a non-integer vote isn't very nice, but at least it works. Or so I hope.
Diffstat (limited to 'lib/VNDB/Handler/Users.pm')
-rw-r--r--lib/VNDB/Handler/Users.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/VNDB/Handler/Users.pm b/lib/VNDB/Handler/Users.pm
index cc5ce28c..cc42f4d0 100644
--- a/lib/VNDB/Handler/Users.pm
+++ b/lib/VNDB/Handler/Users.pm
@@ -76,10 +76,10 @@ sub userpage {
} elsif($votes) {
my($total, $count) = (0, 0);
for (1..@$votes) {
- $total += $_*$votes->[$_-1];
- $count += $votes->[$_-1];
+ $count += $votes->[$_-1][0];
+ $total += $votes->[$_-1][1];
}
- lit mt '_userpage_votes_item', "/u$uid/votes", $count, sprintf '%.2f', $total/$count;
+ lit mt '_userpage_votes_item', "/u$uid/votes", $count, sprintf '%.2f', $total/$count/10;
} else {
txt '-';
}