From a51c3c620eec33305c0ff8388eb4563e06446f6b Mon Sep 17 00:00:00 2001 From: Eriks K Date: Mon, 16 Nov 2020 11:52:27 +0200 Subject: [PATCH] Python round to even bugfix. `{"stock":10.494533,"consume":10.5}` rounds to 0 --- erepublik/citizen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erepublik/citizen.py b/erepublik/citizen.py index ecac466..4402dc8 100644 --- a/erepublik/citizen.py +++ b/erepublik/citizen.py @@ -2569,7 +2569,7 @@ class Citizen(CitizenAnniversary, CitizenCompanies, CitizenEconomy, CitizenLeade if raw_kind: raw_kind = raw_kind.group(1) result = response.get("result", {}) - amount_needed = round(result.get("consume", 0) - result.get("stock", 0) + 0.49) + amount_needed = round(result.get("consume", 0) - result.get("stock", 0) + 0.5) self._report_action( 'WORK_AS_MANAGER', f"Unable to wam! Missing {amount_needed} {raw_kind}, will try to buy.", kwargs=response