diff --git a/src/pages/DexV2/Lock/components/CurrencyInput.tsx b/src/pages/DexV2/Lock/components/CurrencyInput.tsx index f2a9e5b41..ab2d45fa4 100644 --- a/src/pages/DexV2/Lock/components/CurrencyInput.tsx +++ b/src/pages/DexV2/Lock/components/CurrencyInput.tsx @@ -36,13 +36,11 @@ export default function CurrencyInputPanel({ const { account } = useActiveWeb3React() const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined) const theme = useTheme() - - const decimals = (currency?.tokenInfo?.decimals ?? 18) > 4 ? 4 : currency?.tokenInfo?.decimals ?? 18 - + const decimals = currency?.tokenInfo?.decimals || 18 const onChangeInput = (val: string) => { const floatingPart = val.split('.')[1] - const inputDecimals = currency?.decimals || (currency as any)?.tokenInfo?.decimals || 2 - if (floatingPart && currency && inputDecimals < floatingPart.length) return + const inputDecimals = decimals + if (floatingPart && inputDecimals < floatingPart.length) return onUserInput(val) }