fix: use nullish coalescing instead of OR on fraction digits (#5788)

This commit is contained in:
shellawa
2026-04-12 23:14:44 +07:00
committed by GitHub
parent 71e4f7cb91
commit a2a97d1313

View File

@@ -68,7 +68,7 @@ function getMaxDigits(currency: string): number {
style: 'currency', style: 'currency',
currency, currency,
}) })
maxDigits = formatter.resolvedOptions().maximumFractionDigits || 2 maxDigits = formatter.resolvedOptions().maximumFractionDigits ?? 2
} catch { } catch {
maxDigits = 2 maxDigits = 2
} }