When I use the price string from the API, we see 12.99 like we have in the Apple app store. However, when I access the price itself in the Flutter client library, I see 12.989999771118164. I am not manipulating this price at all, I am printing it directly from Flutter lib. Do you think this is: 1) Apple weirdness 2) RevenueCat API bug OR 3) Flutter bug?
Solved
Prices off by 1 cent (ish)
Best answer by ryan
This is due to the nature of floating point decimals. More info in this Stackoverflow post here: https://stackoverflow.com/questions/21895756/why-are-floating-point-numbers-inaccurate
Rounding the float to 2 decimals should land you with the correct formatted currency. There may be some enhancement we could do in the SDK to improve how these are displayed.
This post has been closed for comments
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.