Topic: Issue with local and Number formats with remi's php implementation
Hi there !
At the company I work for, we've been using Centos 7 for a number of years to hosts the websites/application we develop. I've resisted for some reasons from using Remi's repo, so we've been using php from IUS' repo since a long time. Php 7.3, and now PHP 7.4 also, which I found at the time more inline with the way RHEL packages things.
But, that repo has no version of PHP 8, nor PHP 8.1, and probably won't. They also do not have any support for RHEL/CentOS/Rocky version 8. With the base OS, there is a module for PHP 7.4, but not yet fo PHP 8.0, nor PHP 8.1.
So, for Rocky Linux 8, and for PHP 8, I've turned to Remi's repo.
Now, I have face the first difference with the base os version of PHP 7.4 and remi's version of it.
This code :
<?php
print currency_format(1.23);
function currency_format(?float $price, ?string $currency = 'CAD', ?string $locale = null): string
{
$locale = $locale ?? 'fr_CA' ;
$formatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY);
return $formatter->formatCurrency($price, $currency);
}
Outputs on every implementation of PHP, either centos 7 base install, ius version of PHP 7.3, 7.4. With Rocky's base os module of PHP 7.4, etc.
1,23 $
But with Remi's version of PHP, I get :
1,23 $ CA
Wich is anoying and will break the display at many places...
What can be done for this ?