-
Notifications
You must be signed in to change notification settings - Fork 2
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
Negative prices missing minus #48
Comments
Simple repro: <?php
$formatter = new \NumberFormatter('en', \NumberFormatter::CURRENCY);
var_dump($formatter->format('-1')); On Wedos (PHP 7.3), it returns |
Weirdly, for Czech, it shows the minus sign: <?php
foreach (['cs', 'en'] as $lang) {
foreach (['1', '-1'] as $val) {
echo $lang . ' ' . $val . ' ';
$formatter = new \NumberFormatter($lang, \NumberFormatter::CURRENCY);
var_dump($formatter->format($val));
}
} Locally, cs 1 string(9) "1,00 XXX"
cs -1 string(10) "-1,00 XXX"
en 1 string(6) "¤1.00"
en -1 string(7) "-¤1.00" On Wedos: cs 1 string(8) "1,00 ¤"
cs -1 string(9) "-1,00 ¤"
en 1 string(6) "¤1.00"
en -1 string(8) "(¤1.00)" |
The library actually uses <?php
foreach (['cs', 'en'] as $lang) {
foreach (['1', '-1'] as $val) {
echo $lang . ' ' . $val . ' ';
$formatter = new \NumberFormatter($lang, \NumberFormatter::CURRENCY);
var_dump($formatter->format($val));
}
} Locally, cs 1 string(9) "1,00 Kč"
cs -1 string(10) "-1,00 Kč"
en 1 string(9) "CZK 1.00"
en -1 string(10) "-CZK 1.00" On Wedos: cs 1 string(9) "1,00 Kč"
cs -1 string(10) "-1,00 Kč"
en 1 string(7) "Kč1.00"
en -1 string(9) "(Kč1.00)" |
Likely, this is due to outdated ICU: Locally:
Wedos:
|
I have asked Wedos to migrate the hosting to newer servers, which should support slightly less outdated services:
Let’s hope that fixes it. |
On Wedos, the negative prices are listed as positive.
The text was updated successfully, but these errors were encountered: