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 8b3de3c commit e564a8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -284,7 +284,7 @@ private function round($number)
break;
}

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

return $number;
Expand Down
Expand Up @@ -179,7 +179,7 @@ public function testReverseTransformWithRounding($type, $scale, $input, $output,
{
$transformer = new PercentToLocalizedStringTransformer($scale, $type, $roundingMode);

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

public function testReverseTransformEmpty()
Expand Down

0 comments on commit e564a8d

Please sign in to comment.