Execute PLAN_FRONTEND.md

This commit is contained in:
2026-03-14 20:42:51 +01:00
parent b9ec67ec00
commit 4369e66dee
9 changed files with 1571 additions and 0 deletions

26
cmd/frontend/format.go Normal file
View File

@@ -0,0 +1,26 @@
package main
import (
"fmt"
"strings"
)
// fmtCount formats a count with a space as the thousands separator.
func fmtCount(n int64) string {
s := fmt.Sprintf("%d", n)
if len(s) <= 3 {
return s
}
var b strings.Builder
start := len(s) % 3
if start > 0 {
b.WriteString(s[:start])
}
for i := start; i < len(s); i += 3 {
if i > 0 {
b.WriteByte(' ')
}
b.WriteString(s[i : i+3])
}
return b.String()
}