Skip to content

Commit

Permalink
List items in descending profit order.
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Aug 14, 2014
1 parent 1514a64 commit af15b01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tradecalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def detail(self, verbose=False):
hop = self.hops[i]
str += " >-> " if i == 0 else " -+- "
str += "%-20s Buy" % route[i]
for item in hop[0]:
for item in sorted(hop[0], key=lambda item: item[1] * item[0].gainCr, reverse=True):
str += " %d*%s," % (item[1], item[0])
str += "\n"
if verbose:
Expand Down

0 comments on commit af15b01

Please sign in to comment.