Skip to content

Commit

Permalink
Right-alight report numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
thinktwice13 committed Mar 18, 2024
1 parent cf73273 commit ee0cb66
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"runtime"
"sort"
"strconv"
"strings"
"sync"
"time"
)
Expand Down Expand Up @@ -337,7 +338,12 @@ func writeFile(data [][]string) (err error) {
w := bufio.NewWriter(file)
for _, row := range data {
for i, cell := range row {
if _, err := fmt.Fprintf(w, "%-*s", widths[i]+2, cell); err != nil {
// If column is dobit or placeni porez, right-align it
if i == 3 || i == 5 {
if _, err := fmt.Fprintf(w, "%-*s", widths[i]+2, strings.Repeat(" ", widths[i]-len(cell))+cell); err != nil {
return err
}
} else if _, err := fmt.Fprintf(w, "%-*s", widths[i]+2, cell); err != nil {
return err
}
}
Expand Down

0 comments on commit ee0cb66

Please sign in to comment.