chore: use locale-based number formatting

This commit is contained in:
2025-09-13 21:12:13 -05:00
parent 398a1b9474
commit 33b8681b19

View File

@@ -81,6 +81,10 @@ type StatusState =
}; };
// Helper functions // Helper functions
const formatNumber = (num: number): string => {
return num.toLocaleString();
};
const getStatusIcon = (status: Status | "Unreachable"): StatusIcon => { const getStatusIcon = (status: Status | "Unreachable"): StatusIcon => {
const statusMap: Record<Status | "Unreachable", StatusIcon> = { const statusMap: Record<Status | "Unreachable", StatusIcon> = {
Active: { icon: CheckCircle, color: "green" }, Active: { icon: CheckCircle, color: "green" },
@@ -323,7 +327,7 @@ function App() {
</TimingRow> </TimingRow>
) : shouldShowTiming ? ( ) : shouldShowTiming ? (
<TimingRow icon={Hourglass} name="Response Time"> <TimingRow icon={Hourglass} name="Response Time">
<Text size="2">{state.timing.health}ms</Text> <Text size="2">{formatNumber(state.timing.health!)}ms</Text>
</TimingRow> </TimingRow>
) : null} ) : null}