Skip to content

Commit c3faf46

Browse files
author
foaly-nr1
committed
Adds comment
1 parent 0b208cb commit c3faf46

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ private function round($number)
266266
if (null !== $this->precision && null !== $this->roundingMode) {
267267
// shift number to maintain the correct scale during rounding
268268
$roundingCoef = pow(10, $this->precision);
269+
// string representation to avoid rounding errors, similar to bcmul()
269270
$number = (string) ($number * $roundingCoef);
270271

271272
switch ($this->roundingMode) {

0 commit comments

Comments
 (0)