From dd46584f26699ab2683cc7d14770457264e294b5 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 3 Oct 2023 05:41:15 +0100 Subject: [PATCH] pass decimals parameter to validateAmount --- src/components/MoneyRequestConfirmationList.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index cdebcf1e5e6f..b71047e3ca36 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -395,7 +395,8 @@ function MoneyRequestConfirmationList(props) { onSendMoney(paymentMethod); } else { // validate the amount for distance requests - if (props.isDistanceRequest && !isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(String(props.iouAmount))) { + const decimals = CurrencyUtils.getCurrencyDecimals(props.iouCurrencyCode); + if (props.isDistanceRequest && !isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(String(props.iouAmount), decimals)) { setFormError('common.error.invalidAmount'); return; } @@ -404,7 +405,7 @@ function MoneyRequestConfirmationList(props) { onConfirm(selectedParticipants); } }, - [selectedParticipants, onSendMoney, onConfirm, props.iouType, props.isDistanceRequest, isDistanceRequestWithoutRoute, props.iouAmount], + [selectedParticipants, onSendMoney, onConfirm, props.iouType, props.isDistanceRequest, isDistanceRequestWithoutRoute, props.iouCurrencyCode, props.iouAmount], ); const footerContent = useMemo(() => {