-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '#55-format-large-numbers'
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
documentation/adrs/0009-format-large-numbers-with-separator-chars.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,4 @@ | |
# Go workspace file | ||
go.work | ||
.DS_Store | ||
set-plausible-api-key.sh | ||
set-api-keys.sh |