Skip to content

NumberFormatter parsing fails #12727

Closed
Closed
@alexandrunastase

Description

@alexandrunastase

Description

The following code:

<?php

$formatter = new NumberFormatter('de_DE', NumberFormatter::DECIMAL);
$result = $formatter->parse('100,01') 
// Expected: 100.01
// Actual: false

$result = $formatter->parse('1.100,01') 
// Expected: 1100.01
// Actual: 1.1

I created a docker-compose project that contains a phpunit test with multiple data that are working fine in PHP 8.1.3, but do not in 8.1.25 : https://github.com/alexandrunastase/reproduce-number-formatter-issue.

I also tried 8.2.12 and the issue is present there as well

Tried both de_DE and ro_RO locales and both are behaving the same.

PHP Version

PHP 8.1.25, PHP 8.2.12

Operating System

alpine

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions