Question

How to show annual subscription price per month?

  • 20 August 2022
  • 3 replies
  • 64 views

Badge +2

Sorry if it was asked before, I searched but couldn’t find anything :(

What is the best way to calculate the price for annual subscription per month/week? I want to show user, how much he/she will pay for an annual subscription each month or week.

I see that there is a pricePerMonth property on StoreProduct and it calculates correctly, but it shows only the numbers, without currency symbols such as $.

Thank you!


3 replies

Userlevel 4
Badge +7

You will want to use the number formatting methods of the respective platform you are using, e.g., NSNumberFormatter on iOS or NumberFormat on Android. (If you are using a hybrid toolkit such as React Native or Flutter, they have methods / packages for this as well).

Is it possible to get Locale for StoreProduct? (on iOS)

Userlevel 4
Badge +7

You should be able to get the NumberFormatter from the StoreProduct, and you can get the locale from the NumberFormatter.

Reply