From f4c379b0d446f216ed147dd838ef4493bfa7927e Mon Sep 17 00:00:00 2001 From: Mike Johnston Date: Tue, 24 Mar 2026 01:57:04 -0400 Subject: [PATCH] more grainular pph math --- src/lib/mastodon.ts | 2 +- src/lib/pricing.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/mastodon.ts b/src/lib/mastodon.ts index 815d255..c1ba994 100644 --- a/src/lib/mastodon.ts +++ b/src/lib/mastodon.ts @@ -216,6 +216,6 @@ export async function getPostsData( `pph: ${postsPerHour.toFixed(2)} (${method})`, ) - return { postsPerHour, relatedTags, displayTag, hasAnyPosts: true } + return { postsPerHour: Math.round(postsPerHour * 10) / 10, relatedTags, displayTag, hasAnyPosts: true } } diff --git a/src/lib/pricing.ts b/src/lib/pricing.ts index 932daf0..836c727 100644 --- a/src/lib/pricing.ts +++ b/src/lib/pricing.ts @@ -12,10 +12,10 @@ * 3 600 (viral) → $250.00 (design target) * Asymptote → ~$346 * - * Floor: $0.25 (matches zero-PPH floor price). + * Floor: $0.25 for ≤ 1 PPH. */ export function calcPrice(postsPerHour: number): number { - if (postsPerHour <= 0) return 0.25 + if (postsPerHour <= 1) return 0.25 const base = 0.25 // The base price at low volumes (1 PPH) const anchor = 3600 // PPH at which we want the target price (1 PPS) const target = 250 // price at the anchor PPH