General Questions
How accurate are the PPP calculations?
How accurate are the PPP calculations?
The calculations are based on official World Bank data (indicator
PA.NUS.PPPC.RF), which is collected through the International Comparison Program involving detailed price surveys across hundreds of goods and services.However, accuracy depends on several factors:- Data freshness: World Bank updates annually, so data may be 6-12 months old
- Product category: PPP ratios reflect general purchasing power, not specific product categories
- Regional variations: A single ratio applies to the entire country, but costs vary by city/region
- Smoothing factor: The default 0.2 smoothing adds a normalization layer
Why does the function return null?
Why does the function return null?
The 2. Country not in World Bank dataSome very small territories or regions without economic data are not included in the World Bank’s PPP database.How to handle null returns:Use
ppp() function returns null in these specific cases:1. Invalid country codeppp.factor(countryCode) to check if a country code exists before calculating prices.What's the difference between 2-letter and 3-letter country codes?
What's the difference between 2-letter and 3-letter country codes?
The package supports both ISO 3166-1 alpha-2 (2-letter) and alpha-3 (3-letter) country codes, and they work identically:Internally, both codes are stored in
data.json pointing to the same PPP ratio. The lookup is case-insensitive, so 'lk', 'LK', 'Lk' all work.Use whichever format is more convenient for your application - the package handles the conversion automatically.How often should I update the data?
How often should I update the data?
The World Bank updates PPP indicators annually, typically releasing new data mid-year.Recommended update schedule:The data is relatively stable year-over-year for most countries, so quarterly updates are usually unnecessary unless there are major economic disruptions.
- Annual updates: Run the update script once per year (June-August)
- After major economic events: Currency crises, hyperinflation, or significant policy changes
- Before pricing reviews: Ensure you have current data when adjusting your pricing strategy
Technical Questions
Why use smoothing? What happens with smoothing = 0?
Why use smoothing? What happens with smoothing = 0?
Raw PPP prices (smoothing = 0) can be too aggressive, making prices so low they may not be sustainable for your business.Example: $100 product in IndiaThe smoothing formula:
- Smoothing = 0: Full PPP adjustment (maximum discount)
- Smoothing = 0.2 (default): 80% of the discount
- Smoothing = 1: No adjustment (original price)
How does 'pretty' rounding work?
How does 'pretty' rounding work?
The Prices 100 → Round to nearest integerPrices over $100 → Round to nearest 5This creates psychologically appealing prices like 49, or 4.31, 147.22.
'pretty' rounding option creates marketing-friendly prices that look better to customers.Rounding rules based on price range:Prices under $10 → End in .49 or .99What happens if I pass invalid parameters?
What happens if I pass invalid parameters?
The package validates all inputs and throws descriptive errors:Invalid price:Invalid country code type:Invalid smoothing:Invalid rounding:
Invalid country codes don’t throw errors - they return
null instead, allowing graceful fallback handling.Can I use this package in the browser?
Can I use this package in the browser?
Yes! The package is dependency-free for clients, meaning it has zero runtime dependencies.The only dependencies (The
axios, xlsx, country-code-lookup) are used by the data update script (scripts/update-data.js), which runs server-side or during development.For client-side usage:data.json file (~15KB) is bundled with the package, so the entire runtime footprint is minimal.How do I handle countries with PPP ratio > 1?
How do I handle countries with PPP ratio > 1?
Countries with PPP ratios above 1.0 (like Switzerland, Iceland, or Bermuda) have higher costs of living than the United States.Example:What this means for pricing:Technically, you could charge MORE in these countries since purchasing power is higher. However, most businesses choose to:This ensures you never charge more than your base price, only offer discounts for lower purchasing power countries.
- Keep the original price (use smoothing = 1)
- Apply minimal adjustment (the default smoothing of 0.2 already minimizes the increase)
- Cap prices at original (custom logic)
Pricing Strategy Questions
Should I show different prices or apply discounts at checkout?
Should I show different prices or apply discounts at checkout?
Both approaches work, but they have different implications:Display different prices (Localized Pricing):Pros:
- Transparent - customers see fair prices upfront
- Better conversion - no sticker shock
- Builds trust in emerging markets
- May cause friction if users compare across regions
- Requires geolocation to detect country
- Everyone sees the same base price
- Discount feels like a special offer
- Easier to implement
- Less transparent
- Cart abandonment if no discount expected
Many successful SaaS companies use display localized pricing for new customers and honor historical pricing for existing customers to avoid confusion.
How do I detect the user's country?
How do I detect the user's country?
The PPP package handles calculation only - you need to determine the country code separately.Common approaches:1. IP Geolocation (automatic)2. User selection (manual)3. Billing address (at checkout)
IP geolocation is convenient but can be inaccurate (VPNs, proxies). Consider combining methods or allowing manual override.
What's a good smoothing value for SaaS products?
What's a good smoothing value for SaaS products?
The optimal smoothing depends on your business model and target market:0.2 (Default) - Balanced approachTrack conversion rates and lifetime value across smoothing values to find your optimal balance.
- Good for most SaaS products
- Provides meaningful discounts without excessive losses
- Recommended starting point
- Maximizes market penetration in emerging markets
- Use if customer acquisition is priority over immediate revenue
- Good for freemium products with upsell potential
- Smaller discounts, higher margins
- Use for premium products or niche markets
- Better for high-touch sales or enterprise products