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

Fix discounts issues #1038

Merged
merged 2 commits into from
Jul 4, 2020
Merged

Fix discounts issues #1038

merged 2 commits into from
Jul 4, 2020

Conversation

neilco
Copy link
Contributor

@neilco neilco commented Jul 3, 2020

This pull request fixes a couple of issues related to discounts (aka introductory and promotional offers):

  1. The product price is a string, but the discount price is a number. Fixed by taking the stringValue of discount.price when adding to the discount dictionary.

  2. If discount.priceLocale is nil, NSNumberFormatter defaults to the system locale rather than the App Store locale. Fixed by defaulting to product.priceLocale if discount.priceLocale is nil. If product.priceLocale is also nil, NSNumberFormatter will then default to the system locale.

neilco added 2 commits July 3, 2020 15:06
The product price uses `[product.price stringValue]`. This change updates the discount price to follow the same pattern.
If discount.priceLocale is nil, NSNumberFormatter defaults to the system locale, which may be different to the App Store locale. This change defaults the NSNumberFormatter locale to the App Store locale (taken from the product) if the discount priceLocale is nil.
Copy link
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

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

Nice fixes! Thanks for your contribution 🏅

@hyochan hyochan merged commit 80c28d9 into hyochan:master Jul 4, 2020
@hyochan hyochan added 🛠 bugfix All kinds of bug fixes 🍗 enhancement New feature or request 📱 iOS Related to iOS labels Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 bugfix All kinds of bug fixes 🍗 enhancement New feature or request 📱 iOS Related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants