fix: use nullish coalescing instead of OR on fraction digits (#5788)
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user