Round sell and buy prices down to integer

Fixes #135
This commit is contained in:
Jonathan Harris committed 2016-08-09 17:20:16 +01:00
1 parent ab4b1ff3d7
commit 9b54675cdb
3 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -45,8 +45,8 @@ def export(data, kind=COMMODITY_DEFAULT, filename=None):
line = sep.join([
rowheader,
commodity['name'],
commodity['sellPrice'] and str(commodity['sellPrice']) or '',
commodity['buyPrice'] and str(commodity['buyPrice']) or '',
commodity['sellPrice'] and str(int(commodity['sellPrice'])) or '',
commodity['buyPrice'] and str(int(commodity['buyPrice'])) or '',
str(int(commodity['demand'])) if commodity['demandBracket'] else '',
bracketmap[commodity['demandBracket']],
str(int(commodity['stock'])) if commodity['stockBracket'] else '',
+2 -2
View File
@@ -52,9 +52,9 @@ def export_commodities(data):
for commodity in data['lastStarport'].get('commodities', []):
commodities.append({
'name' : commodity['name'],
'buyPrice' : commodity['buyPrice'],
'buyPrice' : int(commodity['buyPrice']),
'supply' : int(commodity['stock']),
'sellPrice' : commodity['sellPrice'],
'sellPrice' : int(commodity['sellPrice']),
'demand' : int(commodity['demand']),
})
if commodity['stockBracket']:
+2 -2
View File
@@ -43,8 +43,8 @@ def export(data):
for commodity in sorted(bycategory[category], key=itemgetter('name')):
h.write(' %-23s %7d %7d %9s%c %8s%c %s\n' % (
commodity['name'],
commodity['sellPrice'],
commodity['buyPrice'],
int(commodity['sellPrice']),
int(commodity['buyPrice']),
int(commodity['demand']) if commodity['demandBracket'] else '',
demandbracketmap[commodity['demandBracket']],
int(commodity['stock']) if commodity['stockBracket'] else '',