From c14a69a25c000182d5aff0ce50f52fe824c7ae8b Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Thu, 9 Nov 2017 16:28:22 +0000 Subject: Allow temperature conversion to work with upper or lowercase --- blaunits.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'blaunits.rb') 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 -- cgit v1.2.3