Skip to content

Commit

Permalink
numberToReadable will return an int if the $shorthand is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkwsra committed Feb 17, 2025
1 parent 3a778ca commit 0a51c06
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Interaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ static public function numberToReadable($number, $precision = 1, $divisors = nul
}
}

return number_format($number / $divisor, $precision).$shorthand;
$precision = empty($shorthand) ? 0 : $precision;

return number_format($number / $divisor, $precision) . $shorthand;
}


Expand Down

0 comments on commit 0a51c06

Please sign in to comment.