From d7c479fa6d8e9297a23017c60788c918208cfd9d Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 19 Apr 2023 11:01:49 +0000 Subject: % values in format_poll() should be rounded --- include/text.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index f1a7f5fbf..13b385e98 100644 --- a/include/text.php +++ b/include/text.php @@ -1929,18 +1929,18 @@ function format_poll($item,$s,$opts) { $output .= '  ' . $text . '' . EOL; $output .= '
'; - $output .= '
'; + $output .= '
'; $output .= '
'; - $output .= '
' . sprintf(tt('%d Vote', '%d Votes', $total, 'noun'), $total) . ' | ' . (($totalResponses) ? intval($total / $totalResponses * 100) . '%' : '0%') . '
'; + $output .= '
' . sprintf(tt('%d Vote', '%d Votes', $total, 'noun'), $total) . ' | ' . (($totalResponses) ? round($total / $totalResponses * 100) . '%' : '0%') . '
'; $output .= EOL; } else { //$output .= '[ ] ' . $text . ' (' . $total . ')' . EOL; $output .= '  ' . $text . '' . EOL; $output .= '
'; - $output .= '
'; + $output .= '
'; $output .= '
'; - $output .= '
' . sprintf(tt('%d Vote', '%d Votes', $total, 'noun'), $total) . ' | ' . (($totalResponses) ? intval($total / $totalResponses * 100) . '%' : '0%') . '
'; + $output .= '
' . sprintf(tt('%d Vote', '%d Votes', $total, 'noun'), $total) . ' | ' . (($totalResponses) ? round($total / $totalResponses * 100) . '%' : '0%') . '
'; $output .= EOL; } } @@ -1965,18 +1965,18 @@ function format_poll($item,$s,$opts) { if ($activated && $commentable) { $output .= '  ' . $text . '' . EOL; $output .= '
'; - $output .= '
'; + $output .= '
'; $output .= '
'; - $output .= '
' . sprintf(tt('%d Vote', '%d Votes', $total, 'noun'), $total) . ' | ' . (($totalResponses) ? intval($total / $totalResponses * 100) . '%' : '0%') . '
'; + $output .= '
' . sprintf(tt('%d Vote', '%d Votes', $total, 'noun'), $total) . ' | ' . (($totalResponses) ? round($total / $totalResponses * 100) . '%' : '0%') . '
'; $output .= EOL; } else { $output .= '  ' . $text . '' . EOL; $output .= '
'; - $output .= '
'; + $output .= '
'; $output .= '
'; - $output .= '
' . sprintf(tt('%d Vote', '%d Votes', $total, 'noun'), $total) . ' | ' . (($totalResponses) ? intval($total / $totalResponses * 100) . '%' : '0%') . '
'; + $output .= '
' . sprintf(tt('%d Vote', '%d Votes', $total, 'noun'), $total) . ' | ' . (($totalResponses) ? round($total / $totalResponses * 100) . '%' : '0%') . '
'; $output .= EOL; } } -- cgit v1.2.3