Skip to content

In french locale, useNumberField replace dot by non-breaking space instead of a comma #7866

Closed
@romain-inqom

Description

@romain-inqom

Provide a general summary of the issue here

In french locale, NumberParser of the @internationalized/number package replace the dot by a non-breaking space.

In fact, in France, the dot can be used as a decimal separator and never as a separator of thousands.

🤔 Expected Behavior?

In locale fr-Fr, the dot should be replace by a comma.

😯 Current Behavior

In french locale, useNumberField replace dot by non-breaking space.

💁 Possible Solution

In the file packages/@internationalized/number/src/NumberParser.ts, I suggest to replace this code :

    if (this.options.locale === 'fr-FR') {
      value = replaceAll(value, '.', String.fromCharCode(8239));
    }

by

    if (this.options.locale === 'fr-FR') {
      value = replaceAll(value, '.', ',');
    }

🔦 Context

No response

🖥️ Steps to Reproduce

To reproduce the problem, your Browser must be in French. You'll be able to reproduce the video manipulation.

Enregistrement.de.l.ecran.2025-03-05.a.10.49.37.mov

Version

latest

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macOS Sequoia

🧢 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