diff --git a/brmbar3/brmbar/Shop.py b/brmbar3/brmbar/Shop.py index c219be1..fcc54be 100644 --- a/brmbar3/brmbar/Shop.py +++ b/brmbar3/brmbar/Shop.py @@ -126,9 +126,12 @@ class Shop: #self.withdraw_credit(amount, userfrom) def buy_for_cash(self, item, amount = 1): + iamount = int(amount) + famount = float(iamount) + assert famount == amount, "amount is not integer value %s".format(amount) cost = self.db.execute_and_fetch( "SELECT public.buy_for_cash(%s, %s, %s, %s, %s)", - [self.cash.id, item.id, amount, self.currency.id, item.name] + [self.cash.id, item.id, iamount, self.currency.id, item.name] )[0] # Buy: Currency conversion from item currency to shop currency #(buy, sell) = item.currency.rates(self.currency)