Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 12a890f

Browse files
committed
Issue 5288 fix
1 parent ee90986 commit 12a890f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/Symfony/Component/Locale/Tests/Stub/StubNumberFormatterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public function testFormatCurrencyWithCurrencyStyleBrazilianRealRoundingIntl($va
210210

211211
public function formatCurrencyWithCurrencyStyleBrazilianRealRoundingProvider()
212212
{
213-
$brl = $this->isIntlExtensionLoaded() && $this->isSameAsIcuVersion('4.8') ? 'BR' : 'R';
213+
$brl = $this->isIntlExtensionLoaded() && $this->isGreaterOrEqualThanIcuVersion('4.8') ? 'BR' : 'R';
214214

215215
return array(
216216
array(100, 'BRL', $brl, '%s$100.00'),

src/Symfony/Component/Locale/Tests/TestCase.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,16 @@ protected function isLowerThanIcuVersion($version)
8989

9090
protected function normalizeIcuVersion($version)
9191
{
92-
return ((float) $version) * 100;
92+
$versionIds = explode(".", $version);
93+
94+
$multi = 1000;
95+
$intVersion = 0;
96+
foreach ($versionIds as $id) {
97+
$intVersion += $id * $multi;
98+
$multi = $multi/10;
99+
}
100+
101+
return (int) $intVersion;
93102
}
94103

95104
protected function getIntlExtensionIcuVersion()

0 commit comments

Comments
 (0)