Skip to content

v20.19 Number.prototype.toLocaleString() #57608

@zomgbre

Description

@zomgbre

Version

20.19.0

Platform


Subsystem

No response

What steps will reproduce the bug?

Be running on v20.19 of Node and execute the below jest test or just run the code and observe localizedValue is not equal to 1.287,5.

    test('localize valid number with SI number format', () => {
      const num = 1287.5;
      const localizedValue = num.toLocaleString('it');
      expect(localizedValue).toEqual('1.287,5');
    });

How often does it reproduce? Is there a required condition?

Every time with Node v20.19.

What is the expected behavior? Why is that the expected behavior?

The localization should be 1.287,5 according to:
https://en.wikipedia.org/wiki/Decimal_separator

What do you see instead?

1287.5

Additional information

It may not seem like a big deal, but it is for our customers who rely on accurate representations of values within our application for diagnosing animals.

Where can this change be found in the 20.19 release notes? We were not able to find it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    i18n-apiIssues and PRs related to the i18n implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions