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

Add StoreProduct.pricePerYear #2462

Merged
merged 1 commit into from
May 11, 2023
Merged

Add StoreProduct.pricePerYear #2462

merged 1 commit into from
May 11, 2023

Conversation

NachoSoto
Copy link
Contributor

No description provided.

@NachoSoto NachoSoto added the pr:feat A new feature label May 1, 2023
@NachoSoto NachoSoto requested a review from a team May 1, 2023 16:25
switch self.unit {
case .day: return 1 / 365
case .week: return 1 / 52.14 // Number of weeks in a year
case .month: return 1 / 12
Copy link
Contributor

Choose a reason for hiding this comment

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

This was interesting to me... We seem to be doing integer division here, but seems that the swift compiler is smart enough to do the conversion to Decimal automatically 👍

@NachoSoto NachoSoto merged commit 3f08a95 into main May 11, 2023
@NachoSoto NachoSoto deleted the price-per-year branch May 11, 2023 17:15
NachoSoto added a commit that referenced this pull request May 25, 2023
This was referenced May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:feat A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants