Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round price per period calculations to nearest 2-decimal #4275

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

tonidero
Copy link
Contributor

Description

We were rounding the price per period calculations to the floor of the second decimal of the price. This changes it to round to the closest number following the logic in: https://developer.apple.com/documentation/foundation/nsdecimalnumber/roundingmode

This might help with #4246

@tonidero tonidero added the pr:fix A bug fix label Sep 16, 2024
@tonidero tonidero marked this pull request as ready for review September 16, 2024 12:50
@tonidero tonidero requested a review from a team September 16, 2024 12:50
Copy link
Member

@JayShortway JayShortway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

@tonidero tonidero force-pushed the round-prices-nearest-2-decimal branch from eb33e8c to 4f5d03b Compare September 16, 2024 16:19
@tonidero
Copy link
Contributor Author

Need to update snapshots

@tonidero tonidero merged commit e73f102 into main Sep 17, 2024
5 checks passed
@tonidero tonidero deleted the round-prices-nearest-2-decimal branch September 17, 2024 08:31
This was referenced Sep 18, 2024
nyeu pushed a commit that referenced this pull request Oct 2, 2024
* Round price per period calculations to nearest 2-decimal

* Fix tests

* Update snapshots commit
MojtabaHs pushed a commit to MojtabaHs/purchases-ios that referenced this pull request Dec 12, 2024
…4275)

* Round price per period calculations to nearest 2-decimal

* Fix tests

* Update snapshots commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants