diff --git a/ui/components/app/gas-timing/gas-timing.component.js b/ui/components/app/gas-timing/gas-timing.component.js index 0f28ea7dc..95e5bc24a 100644 --- a/ui/components/app/gas-timing/gas-timing.component.js +++ b/ui/components/app/gas-timing/gas-timing.component.js @@ -71,8 +71,8 @@ export default function GasTiming({ ) { // getGasFeeTimeEstimate requires parameters in string format getGasFeeTimeEstimate( - new BigNumber(priority).toString(10), - new BigNumber(fee).toString(10), + new BigNumber(priority, 10).toString(10), + new BigNumber(fee, 10).toString(10), ).then((result) => { if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) { setCustomEstimatedTime(result); diff --git a/ui/components/ui/numeric-input/numeric-input.component.js b/ui/components/ui/numeric-input/numeric-input.component.js index 0befdf4f6..948ecec92 100644 --- a/ui/components/ui/numeric-input/numeric-input.component.js +++ b/ui/components/ui/numeric-input/numeric-input.component.js @@ -4,6 +4,8 @@ import PropTypes from 'prop-types'; import Typography from '../typography/typography'; import { COLORS, TYPOGRAPHY } from '../../../helpers/constants/design-system'; +const DECIMAL_REGEX = /\.(\d*)/u; + export default function NumericInput({ detailText = '', value = 0, @@ -26,7 +28,10 @@ export default function NumericInput({ } }} onChange={(e) => { - onChange?.(parseFloat(e.target.value || 0, 10)); + const newValue = e.target.value; + const match = DECIMAL_REGEX.exec(newValue); + if (match?.[1]?.length >= 15) return; + onChange?.(parseFloat(newValue || 0, 10)); }} min="0" autoFocus={autoFocus}