Commit 4bf4723a authored by Leo Gordon's avatar Leo Gordon
Browse files

bugfix: more careful rounding up

parent 6e515886
......@@ -89,7 +89,9 @@ sub preliminary_offer {
my $multiplier = $self->multiplier;
if( defined($available_capacity) and defined($multiplier) and ($multiplier >= 0.0) ) { # if multiplier is negative it is not limiting
my $slots_available = int($available_capacity * $multiplier);
my $product = $available_capacity * $multiplier;
my $slots_available = int( "$product" ); # stringification helps to round up things like 0.1*10 (instead of leaving them at 0.99999999)
return ($slots_available<$slots_asked) ? $slots_available : $slots_asked;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment