Skip to main content
Solved

How to show annual subscription price per month?


Forum|alt.badge.img+5

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.

An app already implementing this, is Snapchat. I checked all over revenuecat documentation but didn’t find this feature.

Best answer by Michael Fogel

Hey @collins 

 

A great way of doing this would be calling the priceString property and dividing that number returned by the length of the subscription. For example, for the annual product diving that returned result by 12. This would return the monthly price of the annual product. 

 

 

View original
Did this post help you find an answer to your question?
This post has been closed for comments

15 replies

Michael Fogel
Forum|alt.badge.img+6
  • Dedicated Contributor
  • 382 replies
  • Answer
  • June 12, 2023

Hey @collins 

 

A great way of doing this would be calling the priceString property and dividing that number returned by the length of the subscription. For example, for the annual product diving that returned result by 12. This would return the monthly price of the annual product. 

 

 


vic-a563d7
Forum|alt.badge.img+6
  • Dedicated Member
  • 44 replies
  • October 27, 2023

@Michael Fogel , priceString is already formatted with the currency sign so do you think that is still the only option? I could parse it but not sure I know all possible formats to do it safely for all currencies.
Also, for the denominator, is there a numbers somewhere for 1 (one month), 2 (two months), etc? This way it is more dynamic and we do not need to have a map for each length of subscription.

I think i see a property called `price` with the raw number so maybe that is better..


Forum|alt.badge.img+4

I am trying to do the same and it’s anything but trivial with the limited information the react-native-purchases package provides.

The only method I see right now is dividing price by 12, and the using the currency code to create a price String myself. But I might still run into issues with rounding here? Also it’s super hard to test with all the different currencies without creating hundreds of sandbox users.

I see that for the paywall templates, RC provides a lot of helpful variables like “sub_price_per_month” etc. It would be super helpful to expose these to the Purchases.getOfferings() call in the react-native package.

 


Forum|alt.badge.img+1
  • Member
  • 5 replies
  • November 14, 2024

I really need this feature please add 


joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 385 replies
  • November 14, 2024

Hi @Isaak,

You can now get this through our SDK, you can get the price per week, per month and per year out of the box.

package.storeProduct.pricePerWeek
package.storeProduct.pricePerMonth
package.storeProduct.pricePerYear

You can also get the localized version for all options.

Let me know if this works!


Forum|alt.badge.img+1
  • Member
  • 5 replies
  • November 14, 2024

Yes but it does not come with the currency, I need the currency the full string 


joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 385 replies
  • November 14, 2024

Using the localizedPricePerMonth should include the currency


Forum|alt.badge.img+1
  • Member
  • 5 replies
  • November 14, 2024

Okay nice that is great! thank you so much.

Now also one more thing, is it easy to A/B test pricing walls or pricing with Revenuecat, is it like a 20min thing to set up. Also can you a/b test onboarding as well, and its impact on CLV 


Forum|alt.badge.img+1
  • Member
  • 5 replies
  • November 14, 2024

Wait the localizedPricePerMonth it's not available in react native? I can not see it in the offers object?


Forum|alt.badge.img+1
  • Member
  • 5 replies
  • November 15, 2024

okay i think I found the answer, we can use something like this 

 

  function getFormattedMonthlyPrice(offerings) {

    if (!offerings?.current?.annual?.product) return "";

 

    const annualProduct = offerings.current.annual.product;

    const monthlyPrice = annualProduct.price / 12;

 

    // Use Intl.NumberFormat for formatting

    const formatter = new Intl.NumberFormat(undefined, {

      style: "currency",

      currency: annualProduct.currencyCode,

    });

 

    return formatter.format(monthlyPrice);

  }

where the Intl.NumberFormat is just native javascript functionality big javascript W

 


Forum|alt.badge.img+4
  • Member
  • 5 replies
  • December 27, 2024
joan-cardona wrote:

Using the localizedPricePerMonth should include the currency

Hola Joan!

is this available in the 8.3.2 flutter SDK?

Thanks!

Xavi


Ryan Glanz
RevenueCat Staff
Forum|alt.badge.img+8
  • RevenueCat Staff
  • 383 replies
  • January 3, 2025

This is not in our Flutter SDK at the moment, but I can pass this along as a feature request on your behalf


  • New Member
  • 2 replies
  • February 7, 2025

Hello, I do not want to create a new thread, but I am dealing with a similar problem on Android native. I need to show all offer prices in price per week for comparison. As ​@vic-a563d7 already mentioned it is hard to parse with limited knowledge about all the possible formats and then testing in all possible languages. I would suggest to add to SDK: either different price formats, or a method with lambda to make changes to the price, or formatting method to pass your own price, or any other similar solution.


  • New Member
  • 2 replies
  • February 7, 2025
petr.kuska wrote:

Hello, I do not want to create a new thread, but I am dealing with a similar problem on Android native. I need to show all offer prices in price per week for comparison. As ​@vic-a563d7 already mentioned it is hard to parse with limited knowledge about all the possible formats and then testing in all possible languages. I would suggest to add to SDK: either different price formats, or a method with lambda to make changes to the price, or formatting method to pass your own price, or any other similar solution.

One of possible (hopefully temporary) solutions in Kotlin. Not ideal, but maybe it will help someone:
 

import java.text.NumberFormat
import java.util.Currency

private fun formatPrice(offerPackage: OfferPackage, divider: Int = 1): String? {
    val fullPrice = offerPackage.fullPrice ?: return null
    val currencyCode = fullPrice.currencyCode
    val amountMicros = fullPrice.amountMicros
    val price = (amountMicros / divider) / 1000000.0
    val format: NumberFormat = NumberFormat.getCurrencyInstance()
    format.maximumFractionDigits = 2
    format.currency = Currency.getInstance(currencyCode)
    return format.format(price)
}

val weeklyPriceFormatted = formatPrice(monthlyOffer, 4)
val weeklyPriceFormatted = formatPrice(annualOffer, 52)
 

Forum|alt.badge.img+4
  • Member
  • 7 replies
  • March 6, 2025

Please add this to the Flutter SDK 


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