From 0f5c1193fde1530f947e0b6883cfb02832b5fac6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 02:38:18 +0000 Subject: [PATCH 1/3] Initial plan From 1ac8a6659253cb0260b8bfc7f3dfb338bf0ade63 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 02:49:25 +0000 Subject: [PATCH 2/3] fix: strip trailing .0 in formatCompactCurrency for consistent cross-environment output Fixes CI test failure where Intl.NumberFormat produced "$150.0K" instead of "$150K" in certain Node.js/ICU versions. The regex strips trailing ".0" before compact suffixes (K/M/B/T) while preserving meaningful decimals like "$1.5M". Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- packages/fields/src/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/fields/src/index.tsx b/packages/fields/src/index.tsx index 4e3be1ef18..2918f27472 100644 --- a/packages/fields/src/index.tsx +++ b/packages/fields/src/index.tsx @@ -80,12 +80,15 @@ export function formatCurrency(value: number, currency: string = 'USD'): string */ export function formatCompactCurrency(value: number, currency: string = 'USD'): string { try { - return new Intl.NumberFormat('en-US', { + const formatted = new Intl.NumberFormat('en-US', { style: 'currency', currency, notation: 'compact', maximumFractionDigits: 1, }).format(value); + // Strip trailing ".0" before compact suffix for consistent cross-environment output + // e.g. "$150.0K" → "$150K" while keeping "$1.5M" intact + return formatted.replace(/\.0(?=[KMBT]|$)/, ''); } catch { return `${currency} ${value}`; } From 80a936bdaaac8246c2cdf4665c9c95da1afbe956 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 02:50:05 +0000 Subject: [PATCH 3/3] refine regex to only strip .0 before compact suffixes (K/M/B/T) Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- packages/fields/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fields/src/index.tsx b/packages/fields/src/index.tsx index 2918f27472..cfa1653050 100644 --- a/packages/fields/src/index.tsx +++ b/packages/fields/src/index.tsx @@ -88,7 +88,7 @@ export function formatCompactCurrency(value: number, currency: string = 'USD'): }).format(value); // Strip trailing ".0" before compact suffix for consistent cross-environment output // e.g. "$150.0K" → "$150K" while keeping "$1.5M" intact - return formatted.replace(/\.0(?=[KMBT]|$)/, ''); + return formatted.replace(/\.0(?=[KMBT])/, ''); } catch { return `${currency} ${value}`; }