Skip to content

Commit

Permalink
add precisition
Browse files Browse the repository at this point in the history
  • Loading branch information
riskihajar committed Oct 6, 2023
1 parent 4b3a4f1 commit c8f515c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LargeNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

class LargeNumber
{
public function __invoke(mixed $number, Enum $target = Enum::Million): Stringable
public function __invoke(mixed $number, Enum $target = Enum::Million, ?int $precision = 2): Stringable
{
$result = round($number / $target->divider(), 2);
$result = round($number / $target->divider(), $precision);
$string = implode('', [
$result,
$target->abbreviation(),
Expand Down

0 comments on commit c8f515c

Please sign in to comment.