From 7ec718852856abeb14e7c30fdb7b481c79e0cae0 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 26 Nov 2021 10:23:24 +1100 Subject: [PATCH] Remove unnecessary `toString`ing We no longer need this. --- taker-frontend/src/components/Trade.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/taker-frontend/src/components/Trade.tsx b/taker-frontend/src/components/Trade.tsx index d3f9b93..e16a6c5 100644 --- a/taker-frontend/src/components/Trade.tsx +++ b/taker-frontend/src/components/Trade.tsx @@ -87,7 +87,7 @@ export default function Trade({ askPrice: askPriceAsNumber, quantity, onQuantityChange, - margin: marginAsNumber, + margin, leverage, liquidationPrice: liquidationPriceAsNumber, onLongSubmit, @@ -101,13 +101,12 @@ export default function Trade({ const referencePrice = `$${referencePriceAsNumber?.toLocaleString() || "0.0"}`; const askPrice = `$${askPriceAsNumber?.toLocaleString() || "0.0"}`; const liquidationPrice = `$${liquidationPriceAsNumber?.toLocaleString() || "0.0"}`; - const margin = `₿${marginAsNumber.toLocaleString()}`; const { isOpen, onOpen, onClose } = useDisclosure(); const parse = (val: any) => Number.parseInt(val.replace(/^\$/, "")); - const balanceTooLow = walletBalance && walletBalance < marginAsNumber; + const balanceTooLow = walletBalance && walletBalance < margin; const quantityTooHigh = maxQuantity < parse(quantity); const quantityTooLow = minQuantity > parse(quantity); const quantityGreaterZero = parse(quantity) > 0; @@ -189,7 +188,7 @@ export default function Trade({ - +
@@ -221,12 +220,12 @@ export default function Trade({ - By submitting, ₿{marginAsNumber} will be locked on-chain in a contract. + By submitting, ₿{margin} will be locked on-chain in a contract. - +
Margin₿{marginAsNumber}₿{margin}
Leverage