Skip to content

Commit

Permalink
Merge pull request #1 from asd-lt/patch-1
Browse files Browse the repository at this point in the history
Fix for optional decimal length - '0.0[000]', etc
  • Loading branch information
JohnathonKoster committed Apr 13, 2016
2 parents efa6a85 + cec605b commit fae847c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Numeral.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected function toFixed($number, $decimalPlaces, $optionalDigits = 0)

// Handle the case where there are more decimal places
// than are desired.
if ($currentDecimalLength > $decimalPlaces) {
if ($currentDecimalLength >= $decimalPlaces) {
$roundedValue = round($number, $decimalPlaces);
return $this->addPaddingToNumber($roundedValue, $decimalPlaces, $optionalDigits);
}
Expand Down Expand Up @@ -1002,4 +1002,4 @@ public function unformat($string)
}
}

}
}

0 comments on commit fae847c

Please sign in to comment.