Skip to main content
Question

How to display price per month formatted to local currency?


vic-a563d7
Forum|alt.badge.img+6

Sorry for creating a duplicate of this, but it seems like the conversation stopped and maybe less details.

I wanted to open back up the conversation to get an idea how to clearly show a price per month to the user in their local currency format. I know the SDK gives me the product with a formatted price, and I also see a raw value as well. Taking that value to divide by the right number based on subscription length is what I want to build. It means that we need a map of packageType vs integers. Where to get a list of all possible strings. I created one one month and six month packages and see the values (MONTHLY and SIX_MONTH), what are all the possible values?
I see also a currency code like “USD” that maybe can use to derive a dollar sign. But how to do this for all possible scenarios/countries?
Is there maybe a better way to implement this inside the SDK?
thanks

2 replies

Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 370 replies
  • November 17, 2023

Hi,

We do have a priceFormatter method, that you may find useful. We don’t have a very robust way to map this all out in the SDK at the moment, so most customers will build a dictionary themselves and use that for their preferred currency codes.

 


vic-a563d7
Forum|alt.badge.img+6
  • Author
  • Dedicated Member
  • 44 replies
  • November 20, 2023

Is this available in react-native-purchases? Sorry not sure exactly how this can help. It will know the local currency format?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings