You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the NumberParser from @internationalized/number, I encountered an issue where the string '1,1,1.2' is being parsed incorrectly as 111.2.
🤔 Expected Behavior?
The input string '1,1,1.2' should throw a parsing error (since it is not a valid number format in any locale),
😯 Current Behavior
The input string '1,1,1.2' is parsed as 111.2, which appears to ignore the commas inappropriately and concatenate the numbers.
💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
Import and initialize NumberParser:
import{NumberParser}from'@internationalized/number';constparser=newNumberParser('en-US');// Example localeconstresult=parser.parse('1,1,1.2');console.log(result);// Outputs: 111.2
Observe that the output is 111.2 instead of an error or a correctly parsed value.
Version
3.5.4
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Windows 11
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered:
tihcamos
changed the title
NumberParser does not work as expected
NumberParser: Incorrect Parsing of Comma-Separated Number Strings
Nov 21, 2024
Provide a general summary of the issue here
When using the
NumberParser
from@internationalized/number
, I encountered an issue where the string'1,1,1.2'
is being parsed incorrectly as111.2
.🤔 Expected Behavior?
The input string
'1,1,1.2'
should throw a parsing error (since it is not a valid number format in any locale),😯 Current Behavior
The input string
'1,1,1.2'
is parsed as111.2
, which appears to ignore the commas inappropriately and concatenate the numbers.💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
NumberParser
:111.2
instead of an error or a correctly parsed value.Version
3.5.4
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
Windows 11
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: