Skip to content

Commit

Permalink
Fixed negative number handling
Browse files Browse the repository at this point in the history
  • Loading branch information
CrsiX authored and pnhofmann committed Oct 2, 2019
1 parent 1447bcc commit 51e1bfb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jarviscli/plugins/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ def binary(jarvis, s):
jarvis.say("This is no number, right?", Fore.RED)
return
else:
jarvis.say(bin(n)[2:], Fore.YELLOW)
if n < 0:
jarvis.say("-" + bin(n)[3:], Fore.YELLOW)
else:
jarvis.say(bin(n)[2:], Fore.YELLOW)

0 comments on commit 51e1bfb

Please sign in to comment.