From e16aa4d4eec1a98df2e9cae278bcc8a6295ee001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Thu, 16 May 2024 01:34:19 +0100 Subject: [PATCH] Internationalized/NumberParser: fix TS5.5 build errors (#6329) Co-authored-by: Daniel Lu --- packages/@internationalized/number/src/NumberParser.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@internationalized/number/src/NumberParser.ts b/packages/@internationalized/number/src/NumberParser.ts index 41bf24de7a6..64c03451f3b 100644 --- a/packages/@internationalized/number/src/NumberParser.ts +++ b/packages/@internationalized/number/src/NumberParser.ts @@ -164,9 +164,9 @@ class NumberParserImpl { // extra step for rounding percents to what our formatter would output let options = { ...this.options, - style: 'decimal', - minimumFractionDigits: Math.min(this.options.minimumFractionDigits + 2, 20), - maximumFractionDigits: Math.min(this.options.maximumFractionDigits + 2, 20) + style: 'decimal' as const, + minimumFractionDigits: Math.min((this.options.minimumFractionDigits ?? 0) + 2, 20), + maximumFractionDigits: Math.min((this.options.maximumFractionDigits ?? 0) + 2, 20) }; return (new NumberParser(this.locale, options)).parse(new NumberFormatter(this.locale, options).format(newValue)); }