From 36cc0cf75034e1d8f245b321f44c208e171cf95c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 22 Apr 2025 00:20:48 -0400 Subject: [PATCH] TOSQUASH: 84ad34f51, lingering `float` casts.. --- piker/ui/order_mode.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index 45f30bb5..47a3bb97 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -181,7 +181,6 @@ class OrderMode: line.update_labels(order_info) # update bound-in staged order - # order.price = level mkt: MktPair = self.curr_mkt order.price: Decimal = mkt.quantize( size=level, @@ -245,7 +244,6 @@ class OrderMode: size=y, quantity_type='price', ) - # order.price = y line._on_level_change = update_order_price @@ -396,7 +394,7 @@ class OrderMode: 'oid': oid, }) - if order.price <= 0: + if float(order.price) <= 0: log.error( '*!? Invalid `Order.price <= 0` ?!*\n' # TODO: make this present multi-line in object form @@ -1194,7 +1192,7 @@ async def process_trade_msg( tm = time.time() mode.on_fill( oid, - price=req.price, + price=float(req.price), time_s=tm, ) mode.lines.remove_line(uuid=oid) @@ -1249,7 +1247,7 @@ async def process_trade_msg( tm = details['broker_time'] mode.on_fill( oid, - price=details['price'], + price=float(details['price']), time_s=tm, pointing='up' if action == 'buy' else 'down', )