- Fixed missing formatter loading
This commit is contained in:
1 parent
043fb90f8d
commit
5aa70dfd17
1 file changed
+1
-2
@@ -15,6 +15,7 @@ class NumberExtension implements Extension, FunctionExtension {
|
||||
public string $title = "",
|
||||
) {
|
||||
$this->locale = explode('.', \Locale::getDefault())[0];
|
||||
$this->formatter = new \NumberFormatter($this->locale, \NumberFormatter::CURRENCY);
|
||||
}
|
||||
|
||||
public function exportFunctions(): array
|
||||
@@ -55,8 +56,6 @@ class NumberExtension implements Extension, FunctionExtension {
|
||||
|
||||
public function money(float $money, ? string $currency = null) /* : string|false */
|
||||
{
|
||||
$this->formatter ??= new \NumberFormatter($this->locale, \NumberFormatter::CURRENCY);
|
||||
|
||||
$this->formatter->setTextAttribute(\NumberFormatter::CURRENCY_CODE, 'CAD');
|
||||
|
||||
$this->formatter->setPattern( str_replace('¤#','¤ #', $this->formatter->getPattern() ) );
|
||||
|
||||
Reference in new issue
Block a user