Skip to content
Extraits de code Groupes Projets
Valider e51b9963 rédigé par mattab's avatar mattab
Parcourir les fichiers

Fixes Call to undefined function bcdiv

parent 9ced7c48
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -229,7 +229,8 @@ class NumberFormatter extends Singleton
// Ensure that the value is positive and has the right number of digits.
$negative = $this->isNegative($value);
$signMultiplier = $negative ? '-1' : '1';
$value = bcdiv($value, $signMultiplier, $maximumFractionDigits);
$value = $value / $signMultiplier;
$value = round($value, $maximumFractionDigits);
// Split the number into major and minor digits.
$valueParts = explode('.', $value);
$majorDigits = $valueParts[0];
......
......@@ -57,8 +57,8 @@ class NumberFormatterTest extends \PHPUnit_Framework_TestCase
array('be', 51239.56, 3, 0, '51 239,56'),
array('de', 51239.56, 3, 0, '51.239,56'),
array('bn', 152551239.56, 3, 0, '15,25,51,239.56'),
array('hi', 152551239.56, 0, 0, '15,25,51,239'),
array('lt', -152551239.56, 0, 0, '−152 551 239'),
array('hi', 152551239.56, 0, 0, '15,25,51,240'),
array('lt', -152551239.56, 0, 0, '−152 551 240'),
);
}
......@@ -80,7 +80,7 @@ class NumberFormatterTest extends \PHPUnit_Framework_TestCase
array('en', -5, 0, 3, '-5%'),
array('en', 5.299, 0, 0, '5%'),
array('en', 5.299, 3, 0, '5.299%'),
array('en', -50, 3, 3, '-50.000%'),
array('en', -50, 3, 3, '-50%'),
array('en', 5000, 0, 0, '5,000%'),
array('en', +5000, 0, 0, '5,000%'),
array('en', 5000000, 0, 0, '5,000,000%'),
......@@ -91,8 +91,8 @@ class NumberFormatterTest extends \PHPUnit_Framework_TestCase
array('be', 51239.56, 3, 0, '51 239,56 %'),
array('de', 51239.56, 3, 0, '51.239,56 %'),
array('bn', 152551239.56, 3, 0, '15,25,51,239.56%'),
array('hi', 152551239.56, 0, 0, '15,25,51,239%'),
array('lt', -152551239.56, 0, 0, '−152 551 239 %'),
array('hi', 152551239.56, 0, 0, '15,25,51,240%'),
array('lt', -152551239.56, 0, 0, '−152 551 240 %'),
);
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter