From 1109e27b04f18a1a9e0b7da00b8fadb10dfaad25 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Oct 2024 09:56:35 +0100 Subject: [PATCH 1/3] Display numbers using the locale format in tables --- .../frontend-core/src/components/grid/cells/TextCell.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/cells/TextCell.svelte b/packages/frontend-core/src/components/grid/cells/TextCell.svelte index 0cf0ab2004..1f6415598f 100644 --- a/packages/frontend-core/src/components/grid/cells/TextCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/TextCell.svelte @@ -52,7 +52,11 @@ {:else}
- {value ?? ""} + {#if type === "number"} + {(value ?? "").toLocaleString()} + {:else} + {value ?? ""} + {/if}
{/if} From 1509d7d650928bba8ff92e4207afbb9f1894259a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 18 Oct 2024 10:44:36 +0100 Subject: [PATCH 2/3] Use single number formatter for more performant locale string conversions --- .../frontend-core/src/components/grid/cells/TextCell.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/cells/TextCell.svelte b/packages/frontend-core/src/components/grid/cells/TextCell.svelte index 1f6415598f..b6b6756068 100644 --- a/packages/frontend-core/src/components/grid/cells/TextCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/TextCell.svelte @@ -1,3 +1,7 @@ + + + - + diff --git a/packages/frontend-core/src/components/grid/cells/TextCell.svelte b/packages/frontend-core/src/components/grid/cells/TextCell.svelte index b6b6756068..9275bca3c6 100644 --- a/packages/frontend-core/src/components/grid/cells/TextCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/TextCell.svelte @@ -1,7 +1,3 @@ - -