From cec605b5b73e77acc5a84ec6656bb73f122ba707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simonas=20Dimavi=C4=8Dius?= Date: Wed, 13 Apr 2016 12:08:11 +0300 Subject: [PATCH] Fix for optional decimal length - '0.0[000]', etc IDK if it is universal fix, but that worked for me. Before that optional decimal length didn't work. --- src/Numeral.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Numeral.php b/src/Numeral.php index 8a94b72e..b8f8d395 100644 --- a/src/Numeral.php +++ b/src/Numeral.php @@ -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); } @@ -1002,4 +1002,4 @@ public function unformat($string) } } -} \ No newline at end of file +}