Skip to content

Commit

Permalink
added optional locale field
Browse files Browse the repository at this point in the history
  • Loading branch information
VitalyDevico committed Aug 27, 2024
1 parent b74562b commit 5a9599f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5a9599f

Please sign in to comment.