From 13967d7f920b2c7f08596e8cf348a716dc33039d Mon Sep 17 00:00:00 2001 From: Aldo Canepa Garay <87341702+aldo-expensify@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:15:10 +0700 Subject: [PATCH] Merge pull request #28685 from akinwale/task-27255-2 fix: pass decimals parameter to validateAmount in MoneyRequestConfirmationList (cherry picked from commit 74112a0c1f0c26994b74bb83efe4ccd53b781d1a) --- 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 c36ae3a85f0f..a219ea5a1504 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(() => {