Skip to content

Commit

Permalink
fixed int size
Browse files Browse the repository at this point in the history
  • Loading branch information
dundee committed May 22, 2021
1 parent 29e298c commit 9a16bb2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
9 changes: 0 additions & 9 deletions tui/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ const (
K int = 1e3
M int = 1e6
G int = 1e9
T int = 1e12
P int = 1e15
E int = 1e18
)

func (ui *UI) formatFileRow(item analyze.Item) string {
Expand Down Expand Up @@ -113,12 +110,6 @@ func (ui *UI) formatCount(count int) string {
color := "[-::]"

switch {
case count >= E:
row += fmt.Sprintf("%.1f%sE", float64(count)/float64(E), color)
case count >= P:
row += fmt.Sprintf("%.1f%sP", float64(count)/float64(P), color)
case count >= T:
row += fmt.Sprintf("%.1f%sT", float64(count)/float64(T), color)
case count >= G:
row += fmt.Sprintf("%.1f%sG", float64(count)/float64(G), color)
case count >= M:
Expand Down
3 changes: 0 additions & 3 deletions tui/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,4 @@ func TestFormatCount(t *testing.T) {
assert.Equal(t, "1.0[-::]k", ui.formatCount(1<<10))
assert.Equal(t, "1.0[-::]M", ui.formatCount(1<<20))
assert.Equal(t, "1.1[-::]G", ui.formatCount(1<<30))
assert.Equal(t, "1.1[-::]T", ui.formatCount(1<<40))
assert.Equal(t, "1.1[-::]P", ui.formatCount(1<<50))
assert.Equal(t, "1.2[-::]E", ui.formatCount(1<<60))
}

0 comments on commit 9a16bb2

Please sign in to comment.