Browse Source

Always use ceil() -- we want an int() and we would like it to not be 0

Zachary Kotlarek 13 năm trước cách đây
mục cha
commit
70e4d2ea66
1 tập tin đã thay đổi với 4 bổ sung và 1 xóa
  1. 4 1
      dmx/projectorPower.pl

+ 4 - 1
dmx/projectorPower.pl

@@ -244,12 +244,15 @@ sub sayShutdown($) {
 
 	# Determine the unit
 	my $unit     = 'minute';
-	my $timeLeft = ceil($minutesLeft);
+	my $timeLeft = $minutesLeft;
 	if ($minutesLeft < 1) {
 		$timeLeft = $minutesLeft * 60;
 		$unit     = 'second';
 	}
 
+	# Avoid saying "0" unless we *really* mean it
+	$timeLeft = ceil($timeLeft);
+
 	# Add an "s" as needed
 	my $plural = 's';
 	if ($timeLeft == 1) {