From f241c79bc33d5fa573a7b7395650e5ac1fdb80cb Mon Sep 17 00:00:00 2001 From: jejolare Date: Wed, 11 Mar 2026 12:34:00 +0100 Subject: [PATCH] fix 400 error on order creation --- src/controllers/orders.controller.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllers/orders.controller.ts b/src/controllers/orders.controller.ts index 518318d..6d75137 100644 --- a/src/controllers/orders.controller.ts +++ b/src/controllers/orders.controller.ts @@ -65,7 +65,9 @@ class OrdersController { } const totalDecimal = priceDecimal.mul(amountDecimal); - const total = totalDecimal.toFixed(); + const total = totalDecimal + .toDecimalPlaces(secondCurrencyDP, Decimal.ROUND_DOWN) + .toFixed(); const isPriceValid = validateTokensInput(price, secondCurrencyDP).valid; const isAmountValid = validateTokensInput(amount, firstCurrencyDP).valid;