Skip to content

Commit

Permalink
change -1 to 0 if update is called with --zero
Browse files Browse the repository at this point in the history
  • Loading branch information
bgol committed Oct 17, 2014
1 parent c502ff5 commit 7dde501
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ def dumpPrices(dbFilename, withModified=False, stationID=None, file=None, defaul

file.write(" {:<{width}} {:7d} {:6d}".format(items[itemID], fromStn, toStn, width=longestNameLen))
if withModified and modified:
if defaultZero:
if demand == -1: demand = 0
if demandLevel == -1: demandLevel = 0
if stock == -1: stock = 0
if stockLevel == -1: stockLevel = 0
file.write(" {} demand {:>7}L{} stock {:>7}L{}".format(
modified,
demand,
Expand Down

0 comments on commit 7dde501

Please sign in to comment.