Skip to content

Commit

Permalink
Merge branch '#55-format-large-numbers'
Browse files Browse the repository at this point in the history
  • Loading branch information
gernotstarke committed Dec 13, 2023
2 parents 9f7dc5a + 71cbd2c commit cf48c92
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 9. format large numbers with separator chars

Date: 2023-12-12

## Status

Accepted

## Context

The (fairly) large access numbers for the sites result in numbers difficult to read (e.g. 805455).

## Decision

Numbers in the generated HTML table shall be formatted using separators, resulting in e.g. 805.455

We decided to use the following way to get separators:

---
p := message.NewPrinter(language.German)
myStr := p.Sprintf( "%d", 1234567)
// myStr == "1.234.567"

## Consequences

* Some types (e.g. types/TotalsForAllSites) need to carry around both an int PLUS a string representation of the same value.
The string is formatted with decimal separators, whereas the numbers aren't.
1 change: 0 additions & 1 deletion go-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
# Go workspace file
go.work
.DS_Store
set-plausible-api-key.sh
set-api-keys.sh

0 comments on commit cf48c92

Please sign in to comment.