svn commit: r264596 - user/des/fbp/root/poll
Dag-Erling Smørgrav
des at FreeBSD.org
Thu Apr 17 12:01:35 UTC 2014
Author: des
Date: Thu Apr 17 12:01:34 2014
New Revision: 264596
URL: http://svnweb.freebsd.org/changeset/base/264596
Log:
Truncate the percentages.
Modified:
user/des/fbp/root/poll/result.tt
Modified: user/des/fbp/root/poll/result.tt
==============================================================================
--- user/des/fbp/root/poll/result.tt Thu Apr 17 11:57:11 2014 (r264595)
+++ user/des/fbp/root/poll/result.tt Thu Apr 17 12:01:34 2014 (r264596)
@@ -1,4 +1,5 @@
[%-# $FreeBSD$ -%]
+[% USE Math %]
[% USE WikiFormat %]
[% PROCESS lib/html_top %]
[% PROCESS lib/header %]
@@ -32,7 +33,7 @@
[% FOREACH option IN question.options %]
<td>[% option.label | html %]</td>
<td>[% IF option.votes_rs.count > 0 %][% option.votes_rs.count %][% ELSE %]-[% END %]</td>
-<td>[% IF option.votes_rs.count > 0 && question.votes_rs.count > 0 %][% option.votes_rs.count * 100 / question.votes_rs.count %]%[% ELSE %]-[% END %]</td>
+<td>[% IF option.votes_rs.count > 0 && question.votes_rs.count > 0 %][% Math.int(option.votes_rs.count * 100 / question.votes_rs.count) %]%[% ELSE %]-[% END %]</td>
</tr>
[% END %]
</table>
More information about the svn-src-user
mailing list