Skip to content

Carry a rounded kopeck of 100 into the next ruble - #177

Open
SashaMIT wants to merge 1 commit into
wapmorgan:masterfrom
SashaMIT:codered-kopeck-carry
Open

SashaMIT wants to merge 1 commit into
wapmorgan:masterfrom
SashaMIT:codered-kopeck-carry

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

Rounding a ruble amount to two decimals could leave the minor part at 100 kopecks. MoneySpeller::spell(10.996, RUB, short) returned 10 рублей 100 копеек. It now returns 11 рублей. Amounts that already land on a real kopeck, such as 123.45, are unchanged.

Test plan

  • On tip, tests/Russian/MoneySpellerTest.php failed this case: expected 11 рублей, actual 10 рублей 100 копеек
  • After the carry, that file passes (33 tests)
  • Full suite: 1901 tests, 27 pre-existing skips

Made with Cursor

10.996 was spelled as 10 rubles and 100 kopecks.
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant