From daa533e7c6d1c6ff2e8600c5178ac75bf7a2538c Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 4 Oct 2010 22:55:23 -0700 Subject: Bug 601848: Fix percentage_complete searches for all operators on both MySQL and PostgreSQL r=mkanat, a=mkanat (module owner) --- Bugzilla/Bug.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index fccf94a02..327e55ccc 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3327,7 +3327,10 @@ sub percentage_complete { my $actual = $self->actual_time; my $total = $remaining + $actual; return undef if $total == 0; - return 100 * ($actual / $total); + # Search.pm truncates this value to an integer, so we want to as well, + # since this is mostly used in a test where its value needs to be + # identical to what the database will return. + return int(100 * ($actual / $total)); } sub product { -- cgit v1.2.3-24-g4f1b