[in_app_purchase_storekit] Product display price with wrong precision using StoreKit 2 #159080
Labels
p: in_app_purchase
Plugin for in-app purchase
P2
Important issues not at the top of the work list
team-ios
Owned by iOS platform team
triaged-ios
Triaged by iOS platform team
What package does this bug report belong to?
in_app_purchase
What target platforms are you seeing this bug on?
iOS
Have you already upgraded your packages?
Yes
Dependency versions
pubspec.yaml
Steps to reproduce
Expected results
@LouiseHsu Based on comment #116383 (comment) (and because we have an issue with StoreKit 1 where failed transactions can never be completed when testing as per #98484), we wanted to try StoreKit 2.
We expected the formatted localized string of a product price to be displayable as this to the user, like it was with StoreKit 1.
If the defined price is 24.99 in US Dollar,
ProductDetails.price
should contains "$24.99" for US locale.Actual results
We currently have 6 prices defined in App Store Connect and only 2 are displayed as expected with StoreKit 2:
✅ 0.99 -> "$0.99"
❌ 2.99 -> "$2.9899999999999998"
❌ 3.99 -> "$3.9899999999999998"
✅ 8.99 ->"$8.99"
❌ 17.99 -> "$17.990000000000002"
❌ 24.99 -> "$24.990000000000002"
This is the value returned by
ProductDetails.price
.The value from
(productDetails as AppStoreProduct2Details).sk2Product.displayPrice
seems correct.We found a similar issue discussed in RevenueCat: RevenueCat/purchases-ios#2207
Code sample
Code sample
Screenshots or Videos
Screenshots / Video demonstration
Logs
No response
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: