From 146f326cecb8a7644ccbfba6dad0430cd3e67305 Mon Sep 17 00:00:00 2001
From: Brett Wilkins <brett@catalyst.net.nz>
Date: Mon, 29 Aug 2011 16:47:48 +1200
Subject: [PATCH] bug 6724: enable decimals on values greater than 1
---
circ/reserveratios.pl | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl
index 5a86675..9115059 100755
--- a/circ/reserveratios.pl
+++ b/circ/reserveratios.pl
@@ -61,10 +61,12 @@ if (!defined($startdate) or $startdate !~ s/^\s*(\S+)\s*$/$1/) { # strip space
if (!defined($enddate) or $enddate !~ s/^\s*(\S+)\s*$/$1/) { # strip spaces, remove Taint
$enddate = format_date($todaysdate);
}
-if (!defined($ratio) or $ratio !~ s/^\s*(0?\.?\d+)(\.0*)?\s*$/$1/) { # strip spaces, remove Taint
+if (!defined($ratio)) {
$ratio = 3;
}
-if ($ratio == 0) {
+# Force to be a number
+$ratio += 0;
+if ($ratio <= 0) {
$ratio = 1; # prevent division by zero
}
--
1.7.5.4