Skip to content

Commit

Permalink
chore: changed ?? with || for formatMoney
Browse files Browse the repository at this point in the history
  • Loading branch information
ameerul-deriv committed Sep 19, 2024
1 parent 0eb78ef commit 22115bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/format.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const formatMoney = (number: number, options?: FormatMoneyOptions) => {
try {
const { locale = "en-US", currency, decimalPlaces } = options || {};
const currencyPrecision = CurrencyConstants.precision[currency ?? "USD"];
const fractionDigits = decimalPlaces ?? currencyPrecision;
const fractionDigits = decimalPlaces || currencyPrecision;
const formatter = new Intl.NumberFormat(locale, {
minimumFractionDigits: fractionDigits,
maximumFractionDigits: fractionDigits,
Expand Down

0 comments on commit 22115bc

Please sign in to comment.