Skip to content

Commit

Permalink
流量显示精度保留2位
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Mar 7, 2020
1 parent 9f619d2 commit 9039d46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/bytefmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func Bytefmt(bytes uint64) string {
return "0B"
}

result := strconv.FormatFloat(value, 'f', 1, 64)
result := strconv.FormatFloat(value, 'f', 2, 64)
result = strings.TrimSuffix(result, ".0")
return result + unit
}

0 comments on commit 9039d46

Please sign in to comment.