Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

use trailingZeroDisplay: "stripIfInteger" in constructRewardAmount

Steven Teyaecada606f08
diff --git a/apps/web/lib/api/sales/construct-reward-amount.ts b/apps/web/lib/api/sales/construct-reward-amount.ts
index 5e0bee89cb..289dc1afb8 100644
--- a/apps/web/lib/api/sales/construct-reward-amount.ts
+++ b/apps/web/lib/api/sales/construct-reward-amount.ts
@@ -41,7 +41,9 @@ export const constructRewardAmount = (
return `Up to ${
reward.type === "percentage"
? `${max}%`
- : currencyFormatter(max / 100)
+ : currencyFormatter(max / 100, {
+ trailingZeroDisplay: "stripIfInteger",
+ })
}`;
}
}
@@ -53,5 +55,7 @@ export const constructRewardAmount = (
// 2. type AND timelines doesn't match the primary reward
return reward.type === "percentage"
? `${reward.amount}%`
- : currencyFormatter(reward.amount / 100);
+ : currencyFormatter(reward.amount / 100, {
+ trailingZeroDisplay: "stripIfInteger",
+ });
};