From 5a9599ff07dfb6cacd3fc9b3cd8431cb2bb9966d Mon Sep 17 00:00:00 2001 From: VitalyDevico Date: Tue, 27 Aug 2024 12:34:27 +0300 Subject: [PATCH] added optional locale field --- src/helpers/currency.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/currency.js b/src/helpers/currency.js index 3a375b7a4..771414cde 100644 --- a/src/helpers/currency.js +++ b/src/helpers/currency.js @@ -20,8 +20,8 @@ export const getSymbol = (currency, locale = userLocale, amount = 0, isNarrowSym return string.replace(/\d/g, "").trim(); }; -export const getValueWithCurrency = (amount, currency) => { - const userLocale = getUserLocale(); +export const getValueWithCurrency = (amount, currency, locale) => { + const userLocale = locale ?? getUserLocale(); const amountVariable = almostZero(amount) ? 0 : amount; const maxDigits = isZeroDecimal(currency) ? 0 : 2;