Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumberFormat shows incorrect results #4986

Closed
Cluster2a opened this issue Feb 17, 2023 · 1 comment
Closed

NumberFormat shows incorrect results #4986

Cluster2a opened this issue Feb 17, 2023 · 1 comment

Comments

@Cluster2a
Copy link

Cluster2a commented Feb 17, 2023

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.
$numberFormatter = new NumberFormatter('de-DE', 2);
$numberFormatter->setAttribute(7, 2);

$symbol = $numberFormatter->getSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL);
var_dump($numberFormatter->formatCurrency(12345.12345,  $symbol));

The Snipped running on laravel octane (by swoole) will return €12,345.12.

The correct value would be 12.345,12 €, as you can see here: https://onlinephp.io/c/72954

I checked the documentation, and there is no specific stuff regarding the server configuration (https://www.php.net/manual/en/intl.configuration.php).

  1. What did you expect to see?
    A correctly german formatted value: 12.345,12 €

  2. What did you see instead?
    A us formatted value: €70,000.00

  3. What version of Swoole are you using (show your php --ri swoole)?
    5.0.2

  4. What is your machine environment used (show your uname -a & php -v & gcc -v) ?

uname -a

Linux 80b1bb7814a0 5.19.0-31-generic #32-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 20 15:20:08 UTC 2023 x86_64 Linux

php -v

PHP 8.1.15 (cli) (built: Feb  4 2023 00:08:10) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.15, Copyright (c) Zend Technologies
    with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans

gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/11.2.1/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-11.2.1_git20220219/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 11.2.1_git20220219' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-default-ssp --enable-cloog-backend --enable-languages=c,c++,d,objc,go,fortran,ada,jit --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --enable-host-shared --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20220219 (Alpine 11.2.1_git20220219)
@Cluster2a
Copy link
Author

Closing this issue as this is related to the used alpine image: dotnet/dotnet-docker#3844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant