summaryrefslogtreecommitdiff
path: root/lib/slop/types.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/slop/types.rb')
-rw-r--r--lib/slop/types.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/slop/types.rb b/lib/slop/types.rb
index 4cd6136..07d7e62 100644
--- a/lib/slop/types.rb
+++ b/lib/slop/types.rb
@@ -53,7 +53,7 @@ module Slop
class FloatOption < Option
def call(value)
# TODO: scientific notation, etc.
- value =~ /\A-?\d*\.*\d+\z/ && value.to_f
+ value =~ /\A[+-]?\d*\.*\d+\z/ && value.to_f
end
end