Skip to content

NumberParser: Does not parse numbers with apostrophes as thousand seperator #8545

@flecamos

Description

@flecamos

Provide a general summary of the issue here

When using the NumberParser with a string value that includes a ' the output is NaN

new NumberParser("de-CH", { currency: "CHF", style: "currency",}).parse("1'000")

🤔 Expected Behavior?

NumberParser should accept ' as a seperator

😯 Current Behavior

It returns NaN

💁 Possible Solution

No response

🔦 Context

In Switzerland it's common to use the apostrophe as a thousand seperator especially when dealing with money values. See https://en.wikipedia.org/wiki/Decimal_separator#Examples_of_use

🖥️ Steps to Reproduce

          new NumberParser("de-CH", {
            currency: "CHF",
            style: "currency",
          }).parse("1'000"),
        ).toBe(1000);

Version

main branch

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Windows

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions