From 69dfde047e7cc951e7aba3fefce6fde6a10a749c Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 12 Oct 2025 20:00:20 -0700 Subject: [PATCH] Update lemonade.py --- modules/games/lemonade.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/modules/games/lemonade.py b/modules/games/lemonade.py index a7369bf..02928d2 100644 --- a/modules/games/lemonade.py +++ b/modules/games/lemonade.py @@ -301,7 +301,7 @@ def playLemonstand(nodeID, message, celsius=False): # Calculate the unit cost and display the estimated sales from the forecast potential unit = max(0.01, min(cups.unit + lemons.unit + sugar.unit, 4.0)) # limit the unit cost between $0.01 and $4.00 - buffer += " SupplyCost" + locale.currency(unit, grouping=True) + " a cup." + buffer += " SupplyCost" + locale.currency(round(unit, 2), grouping=True) + " a cup." buffer += " Sales Potential:" + str(potential) + " cups." # Display the current inventory @@ -312,21 +312,16 @@ def playLemonstand(nodeID, message, celsius=False): # Display the updated item prices buffer += f"\nPrices: " - buffer += "πŸ₯€:" + \ - locale.currency(cups.cost, grouping=True) + " πŸ“¦ of " + str(cups.count) + "." - buffer += " πŸ‹:" + \ - locale.currency(lemons.cost, grouping=True) + " 🧺 of " + str(lemons.count) + "." - buffer += " 🍚:" + \ - locale.currency(sugar.cost, grouping=True) + " bag for " + str(sugar.count) + "πŸ₯€." - + buffer += "πŸ₯€:" + locale.currency(round(cups.cost, 2), grouping=True) + " πŸ“¦ of " + str(cups.count) + "." + buffer += " πŸ‹:" + locale.currency(round(lemons.cost, 2), grouping=True) + " 🧺 of " + str(lemons.count) + "." + buffer += " 🍚:" + locale.currency(round(sugar.cost, 2), grouping=True) + " bag for " + str(sugar.count) + "πŸ₯€." # Display the current cash gainloss = inventory.cash - inventory.start - buffer += " πŸ’΅:" + \ - locale.currency(inventory.cash, grouping=True) + buffer += " πŸ’΅:" + locale.currency(round(inventory.cash, 2), grouping=True) # if the player is in the red - pnl = locale.currency(gainloss, grouping=True) + pnl = locale.currency(round(gainloss, 2), grouping=True) if "0.00" not in pnl: if pnl.startswith("-"): buffer += "πŸ“ŠP&LπŸ“‰" + pnl @@ -351,7 +346,7 @@ def playLemonstand(nodeID, message, celsius=False): inventory.cups += (newcups * cups.count) inventory.cash -= cost msg = "Purchased " + str(newcups) + " πŸ“¦ " - msg += str(inventory.cups) + " πŸ₯€ in inventory. " + locale.currency(inventory.cash, grouping=True) + f" remaining" + msg += str(inventory.cups) + " πŸ₯€ in inventory. " + locale.currency(round(inventory.cash, 2), grouping=True) + f" remaining" else: msg = "No πŸ₯€ were purchased" except Exception as e: @@ -415,8 +410,8 @@ def playLemonstand(nodeID, message, celsius=False): except Exception as e: return "⛔️invalid input, enter the number of 🍚 bags to purchase" - msg += f"Cost of goods is {locale.currency(unit, grouping=True)}" - msg += f"per πŸ₯€ {locale.currency(inventory.cash, grouping=True)} πŸ’΅ remaining." + msg += f"Cost of goods is {locale.currency(round(unit, 2), grouping=True)}" + msg += f"per πŸ₯€ {locale.currency(round(inventory.cash, 2), grouping=True)} πŸ’΅ remaining." msg += f"\nPrice to Sell? or (G)rocery to buy more πŸ₯€πŸ‹πŸš" # set the last command to price in the inventory db