Update lemonade.py

This commit is contained in:
SpudGunMan
2024-09-19 11:24:59 -07:00
parent 33017aa948
commit 4f93e3f5e2
+11 -11
View File
@@ -264,7 +264,7 @@ def start_lemonade(nodeID, message, celsius=False):
buffer += "wx: " + \
formatted + temperature.units + " " + \
forecastd[list(forecastd)[temperature.forecast]][2] + \
" " + glyph + f"\n"
" " + glyph
# Calculate the potential sales as a percentage of the maximum value
# (lower temperature = fewer sales, severe weather = fewer sales)
@@ -291,19 +291,10 @@ def start_lemonade(nodeID, message, celsius=False):
sugar.cost = sugar.min
sugar.unit = round(sugar.cost / sugar.count, 2)
# Display the updated item prices
buffer += "Prices, "
buffer += "Cups:" + \
locale.currency(cups.cost, grouping=True) + " box of " + str(cups.count) + "."
buffer += " Lemons:" + \
locale.currency(lemons.cost, grouping=True) + " bag of " + str(lemons.count) + "."
buffer += " Sugar:" + \
locale.currency(sugar.cost, grouping=True) + " bag for " + str(sugar.count) + " cups. "
# Calculate the unit cost and display the estimated sales from the forecast potential
unit = cups.unit + lemons.unit + sugar.unit
buffer += locale.currency(unit, grouping=True) + " per cup."
buffer += " Potential Sales:" + str(potential) + " cups " + f"\n"
buffer += " Potential Sales:" + str(potential) + " cups "
# Display the current inventory
buffer += "Inventory"
@@ -311,6 +302,15 @@ def start_lemonade(nodeID, message, celsius=False):
buffer += " Lemons:" + str(inventory.lemons)
buffer += " Sugar:" + str(inventory.sugar)
# Display the updated item prices
buffer += f"\nPrices, "
buffer += "Cups:" + \
locale.currency(cups.cost, grouping=True) + " box of " + str(cups.count) + "."
buffer += " Lemons:" + \
locale.currency(lemons.cost, grouping=True) + " bag of " + str(lemons.count) + "."
buffer += " Sugar:" + \
locale.currency(sugar.cost, grouping=True) + " bag for " + str(sugar.count) + " cups. "
# Display the current cash
gainloss = inventory.cash - inventory.start
buffer += " Cash:" + \