Skip to content

Commit

Permalink
- roundDown function.
Browse files Browse the repository at this point in the history
  • Loading branch information
FarhadShirmardi committed Jan 19, 2022
1 parent cc8f4aa commit 7fdd27e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/numberHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
if (!function_exists('roundDown')) {
function roundDown($number, $precision)
{
$multiplier = 10 ** $precision;
return floor($number * $multiplier) / $multiplier;
$half = 0.5 / 10 ** $precision;
return round($number - $half, $precision);
}
}

0 comments on commit 7fdd27e

Please sign in to comment.