diff --git a/src/Russian/MoneySpeller.php b/src/Russian/MoneySpeller.php index b13b4ac..0926627 100644 --- a/src/Russian/MoneySpeller.php +++ b/src/Russian/MoneySpeller.php @@ -55,6 +55,10 @@ public static function spell( $fractional = fmod($value, $integer ?: 1); $fractional = round($fractional, 2); $fractional = (int)round($fractional * 100); + if ($fractional === 100) { + $integer++; + $fractional = 0; + } switch ($format) { case static::SHORT_FORMAT: diff --git a/tests/Russian/MoneySpellerTest.php b/tests/Russian/MoneySpellerTest.php index c902144..4e68a51 100644 --- a/tests/Russian/MoneySpellerTest.php +++ b/tests/Russian/MoneySpellerTest.php @@ -142,6 +142,12 @@ public function moneyAmountsProvider() MoneySpeller::ACCOUNTING_FORMAT, 'пятьсот гривен 50 копеек', ], + [ + 10.996, + Currency::RUBLE, + MoneySpeller::SHORT_FORMAT, + '11 рублей', + ], ]; }