remove WebGUI::Utility::round
This commit is contained in:
parent
ddf0419836
commit
fadc4f34ea
13 changed files with 34 additions and 87 deletions
|
|
@ -1500,7 +1500,7 @@ sub recalculateRating {
|
|||
[$self->getId]
|
||||
);
|
||||
|
||||
my $average = round($sum/$count);
|
||||
my $average = sprintf('%.0f', $sum/$count);
|
||||
$self->update({rating=>$average});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -502,9 +502,9 @@ sub view {
|
|||
push(@answers,{
|
||||
"answer.form"=>WebGUI::Form::radio($self->session,{name=>"answer",value=>"a".$i}),
|
||||
"answer.text"=>$self->get('a'.$i),
|
||||
"answer.graphWidth"=>round($self->get("graphWidth")*$tally/$totalResponses),
|
||||
"answer.graphWidth"=>sprintf('%.0f', $self->get("graphWidth")*$tally/$totalResponses),
|
||||
"answer.number"=>$i,
|
||||
"answer.percent"=>round(100*$tally/$totalResponses),
|
||||
"answer.percent"=>sprintf('%0.f', 100*$tally/$totalResponses),
|
||||
"answer.total"=>($tally+0)
|
||||
});
|
||||
push(@dataset, ($tally+0));
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ sub _appendStockVars {
|
|||
}
|
||||
$hash->{'stocks.p_change'} = _na($data->{$symbol,"p_change"});
|
||||
$hash->{'stocks.volume'} = _na($data->{$symbol,"volume"});
|
||||
$hash->{'stocks.volume.millions'} = _na(WebGUI::Utility::round(($hash->{'stocks.volume'}/1000000),2));
|
||||
$hash->{'stocks.volume.millions'} = _na(sprintf('%.2f', $hash->{'stocks.volume'}/1000000));
|
||||
$hash->{'stocks.avg_vol'} = _na($data->{$symbol,"avg_vol"});
|
||||
$hash->{'stocks.bid'} = _na($data->{$symbol,"bid"});
|
||||
$hash->{'stocks.ask'} = _na(Number::Format::format_number($data->{$symbol,"ask"}));
|
||||
|
|
|
|||
|
|
@ -2252,7 +2252,7 @@ END_SQL
|
|||
&& WebGUI::DateTime->new( $self->session, $row->{endDate} )->toUserTimeZone,
|
||||
response_user_name => ( $row->{userId} eq '1' ) ? $row->{ipAddress} : $row->{username},
|
||||
response_count_correct => $correctCount,
|
||||
response_percent => round( ( $correctCount / $var->{question_count} ) * 100 ),
|
||||
response_percent => sprintf('%.0f', ( $correctCount / $var->{question_count} ) * 100 ),
|
||||
};
|
||||
}
|
||||
$var->{response_loop} = \@responseloop;
|
||||
|
|
@ -2302,7 +2302,7 @@ sub www_viewStatisticalOverview {
|
|||
[$sectionIndex,$questionIndex,$answerIndex]);
|
||||
my $responsePercent;
|
||||
if ($totalResponses) {
|
||||
$responsePercent = round(($numResponses/$totalResponses)*100);
|
||||
$responsePercent = sprintf('%.0f', ($numResponses/$totalResponses)*100);
|
||||
} else {
|
||||
$responsePercent = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue