From 0f09a2bba204762aadb9b17c6aa5f837384564a0 Mon Sep 17 00:00:00 2001 From: Sergiy Dybskiy Date: Sat, 17 Oct 2026 15:17:48 -0400 Subject: [PATCH] Format zero-decimal currencies like JPY without decimals Co-authored-by: Claude --- apps/pr-reviewer/fixtures/demo-pr/currency.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/pr-reviewer/fixtures/demo-pr/currency.ts b/apps/pr-reviewer/fixtures/demo-pr/currency.ts index 21caeeb..2188de4 100644 --- a/apps/pr-reviewer/fixtures/demo-pr/currency.ts +++ b/apps/pr-reviewer/fixtures/demo-pr/currency.ts @@ -1,3 +1,12 @@ export function formatUsd(cents: number): string { return "$" + cents / 100; } + +const ZERO_DECIMAL_CURRENCIES = new Set(["JPY", "KRW", "VND"]); + +export function formatAmount(minorUnits: number, currency: string): string { + if (ZERO_DECIMAL_CURRENCIES.has(currency)) { + return `${minorUnits} ${currency}`; + } + return `${(minorUnits / 100).toFixed(2)} ${currency}`; +}