mirror of
https://github.com/Xevion/banner.git
synced 2025-12-08 04:06:29 -06:00
chore: use locale-based number formatting
This commit is contained in:
@@ -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}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user