summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2017-11-09 16:28:22 +0000
committerJoe Robinson <joe@lc8n.com>2017-11-09 16:28:22 +0000
commitc14a69a25c000182d5aff0ce50f52fe824c7ae8b (patch)
treee6bd7c7e5de8325ba0a6eeaea8233f9eec57995b
parent5c89953f131dee01b6e8ab51b1727701bdeda470 (diff)
Allow temperature conversion to work with upper or lowercase
-rwxr-xr-xblaunits.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/blaunits.rb b/blaunits.rb
index 39557a3..a9a4f56 100755
--- a/blaunits.rb
+++ b/blaunits.rb
@@ -3,7 +3,7 @@
require 'net/http'
require 'json'
-VERSION = "2.1.0"
+VERSION = "2.2.0"
BINARY_NAME = "units"
begin
@@ -84,10 +84,10 @@ begin
puts "Invalid input! Try !convert [amount] [from-unit] to [to-unit] e.g !convert 2 cm to inches"
exit
end
- if from == "F" && to == "C"
+ if from.upcase == "F" && to.upcase == "C"
temp = (num - 32) / 1.8
puts "#{num} F = #{temp} C"
- elsif from == "C" && to == "F"
+ elsif from/upcase == "C" && to.upcase == "F"
temp = (num * 1.8) + 32
puts "#{num} C = #{temp} F"
else