Browse Source

Catch decimal approximations

master
Daniel Muckerman 9 years ago
parent
commit
bd6fb18590
1 changed files with 14 additions and 4 deletions
  1. +14
    -4
      slack-numberman/commands/calculate.rb

+ 14
- 4
slack-numberman/commands/calculate.rb View File

@ -42,10 +42,20 @@ module SlackMathbot
else
# Check the other possible name for real solutions
solution = pods["Real solutions"]
# Prettify equivalency
solution[0].sub! "~~", ""
puts solution
send_message client, _data.channel, solution[0]
if solution != nil
# Prettify equivalency
solution[0].sub! "~~", ""
puts solution
send_message client, _data.channel, solution[0]
else
decimal = pods["Decimal approximation"]
if decimal != nil
puts decimal
send_message client, _data.channel, decimal[0]
end
end
end
end
end

Loading…
Cancel
Save