Commit 9d853bb36 for llama.cpp
commit 9d853bb36a15f74e073a5f560c06a043adcdb3ce
Author: Giovanni Rivera <rivera.giovanni271@gmail.com>
Date: Mon Oct 5 05:57:41 2026 -0700
webui: Use toLocaleString() format consistently across chat message statistics (#27990)
* webui: Use toLocaleString() format consistently across chat message statistics
* Add missing semicolon
* ui: respect lint
diff --git a/tools/ui/src/lib/components/app/chat/ChatMessages/ChatMessageStatistics/ChatMessageStatistics.svelte b/tools/ui/src/lib/components/app/chat/ChatMessages/ChatMessageStatistics/ChatMessageStatistics.svelte
index 4d8b1da2b..51cc4b029 100644
--- a/tools/ui/src/lib/components/app/chat/ChatMessages/ChatMessageStatistics/ChatMessageStatistics.svelte
+++ b/tools/ui/src/lib/components/app/chat/ChatMessages/ChatMessageStatistics/ChatMessageStatistics.svelte
@@ -124,6 +124,11 @@
);
let formattedAgenticTotalTime = $derived(formatPerformanceTime(agenticTotalTimeMs));
+
+ const fixedFormatter = new Intl.NumberFormat(undefined, {
+ maximumFractionDigits: 2,
+ minimumFractionDigits: 2
+ });
</script>
{#snippet viewButton(opts: {
@@ -223,14 +228,14 @@
class="bg-transparent"
icon={Gauge}
tooltipLabel="Generation speed"
- value="{tokensPerSecond.toFixed(2)} t/s"
+ value="{fixedFormatter.format(tokensPerSecond)} t/s"
/>
{:else if activeView === ChatMessageStatsView.TOOLS && hasAgenticStats}
<ChatMessageStatisticsBadge
class="bg-transparent"
icon={Wrench}
tooltipLabel="Tool calls executed"
- value="{agenticTimings!.toolCallsCount} calls"
+ value="{agenticTimings!.toolCallsCount.toLocaleString()} calls"
/>
<ChatMessageStatisticsBadge
@@ -244,14 +249,14 @@
class="bg-transparent"
icon={Gauge}
tooltipLabel="Tool execution rate"
- value="{agenticToolsPerSecond.toFixed(2)} calls/s"
+ value="{fixedFormatter.format(agenticToolsPerSecond)} calls/s"
/>
{:else if activeView === ChatMessageStatsView.SUMMARY && hasAgenticStats}
<ChatMessageStatisticsBadge
class="bg-transparent"
icon={Layers}
tooltipLabel="Agentic turns (LLM calls)"
- value="{agenticTimings!.turns} turns"
+ value="{agenticTimings!.turns.toLocaleString()} turns"
/>
<ChatMessageStatisticsBadge
@@ -272,7 +277,7 @@
class="bg-transparent"
icon={WholeWord}
tooltipLabel="Prompt tokens"
- value="{promptTokens} tokens"
+ value="{promptTokens?.toLocaleString()} tokens"
/>
<ChatMessageStatisticsBadge
@@ -286,7 +291,7 @@
class="bg-transparent"
icon={Gauge}
tooltipLabel="Prompt processing speed"
- value="{promptTokensPerSecond!.toFixed(2)} tokens/s"
+ value="{fixedFormatter.format(promptTokensPerSecond!)} tokens/s"
/>
{/if}
</div>