Skip to content

Commit

Permalink
[core] Use current currency unit for toLocaleString currency (#14904)
Browse files Browse the repository at this point in the history
https://lightsparkgroup.slack.com/archives/C0447HDL3LY/p1737044979159579

GitOrigin-RevId: 32310ff3823b5cbf8b64d71afe34a5838b883290
  • Loading branch information
coreymartin authored and Lightspark Eng committed Jan 16, 2025
1 parent 22c364f commit 0b4a802
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/utils/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,11 @@ export function formatCurrencyStr(
switch (unit) {
case CurrencyUnit.MXN:
case CurrencyUnit.USD:
case CurrencyUnit.PHP:
formattedStr = num.toLocaleString(currentLocale, {
style: "currency",
currency: defaultCurrencyCode,
currency: unit,
currencyDisplay: "narrowSymbol",
notation: compact ? ("compact" as const) : undefined,
maximumFractionDigits: getDefaultMaxFractionDigits(2, 2),
});
Expand Down

0 comments on commit 0b4a802

Please sign in to comment.