Skip to content
Snippets Groups Projects
Commit 9002410a authored by Demian Katz's avatar Demian Katz
Browse files

Merge pull request #318 from EreMaijala/moneyformat-localetweak

Tweaked ICU workaround in SafeMoneyFormat to only touch LC_NUMERIC as th...
parents a9e54b51 6a8d3a8e
No related merge requests found
......@@ -91,12 +91,12 @@ class SafeMoneyFormat extends AbstractHelper
// Workaround for a problem in ICU library < 4.9 causing formatCurrency to
// fail if locale has comma as a decimal separator.
// (see https://bugs.php.net/bug.php?id=54538)
$locale = setlocale(LC_ALL, 0);
setlocale(LC_ALL, ['en_us.UTF-8', 'en_us.UTF8', 'en_us']);
$locale = setlocale(LC_NUMERIC, 0);
setlocale(LC_NUMERIC, ['en_us.UTF-8', 'en_us.UTF8', 'en_us']);
$result = $escaper(
$this->formatter->formatCurrency((float)$number, $currency)
);
setlocale(LC_ALL, $locale);
setlocale(LC_NUMERIC, $locale);
return $result;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment