summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2017-11-09 16:26:09 +0000
committerJoe Robinson <joe@lc8n.com>2017-11-09 16:26:09 +0000
commit5c89953f131dee01b6e8ab51b1727701bdeda470 (patch)
treec8e75f99feab874bddbf033e2ef1f4833ac4c7fd
parent2085cf77bba5c9c72b2a855365a192aaa8ea1be6 (diff)
parent0aa1e642d1ce0950b1dd34c92d4436be9efee8c0 (diff)
Fix merge conflict
-rwxr-xr-xblaunits.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/blaunits.rb b/blaunits.rb
index ffa6578..39557a3 100755
--- a/blaunits.rb
+++ b/blaunits.rb
@@ -84,6 +84,13 @@ 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"
+ temp = (num - 32) / 1.8
+ puts "#{num} F = #{temp} C"
+ elsif from == "C" && to == "F"
+ temp = (num * 1.8) + 32
+ puts "#{num} C = #{temp} F"
+ else
out = %x(#{BINARY_NAME} -t1 #{from} #{to})
outs = out.split(" ")
if outs[0] == "Unknown"
@@ -124,4 +131,5 @@ begin
end
puts "#{num} #{from} = #{num * Float(out)} #{to}"
+ end
end