From a935e6fe563ca9ada14c9dd0ff28551a5e1f69aa Mon Sep 17 00:00:00 2001 From: Katja Lutz Date: Wed, 13 Jul 2022 00:35:01 +0200 Subject: [PATCH] feat: support decimals in position quantity input closes issue #12 --- src/components/Settings/Positions.tsx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/Settings/Positions.tsx b/src/components/Settings/Positions.tsx index bb06cb7..c9b1431 100644 --- a/src/components/Settings/Positions.tsx +++ b/src/components/Settings/Positions.tsx @@ -244,23 +244,23 @@ export const PositionsSettings: Component = () => {
{ - setState( - "positions", - idx(), - "quantity", - parseFloat(e.currentTarget.value) || 0 - ); - }} + lang="en" + onInput={createOptionalNumberInputHandler( + (v) => { + setState( + "positions", + idx(), + "quantity", + v || 0 + ); + } + )} />