Skip to content

Commit

Permalink
Return int if scale = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Feb 22, 2020
1 parent f6f6a60 commit 2993fc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -282,7 +282,7 @@ private function round($number)
break;
}

$number /= $roundingCoef;
$number = 1 === $roundingCoef ? (int) $number : $number / $roundingCoef;
}

return $number;
Expand Down
Expand Up @@ -370,7 +370,7 @@ public function testReverseTransformWithRounding($scale, $input, $output, $round
{
$transformer = new NumberToLocalizedStringTransformer($scale, null, $roundingMode);

$this->assertEquals($output, $transformer->reverseTransform($input));
$this->assertSame($output, $transformer->reverseTransform($input));
}

public function testReverseTransformDoesNotRoundIfNoScale()
Expand Down

0 comments on commit 2993fc9

Please sign in to comment.