Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Apr 2014 12:01:35 +0000 (UTC)
From:      Dag-Erling Smørgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r264596 - user/des/fbp/root/poll
Message-ID:  <201404171201.s3HC1Zln018117@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404171201.s3HC1Zln018117>