Skip to content

Commit c9e11db

Browse files
committed
common: fix size comparison in StorageSize ethereum#33105
1 parent 28a4f25 commit c9e11db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/size.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type StorageSize float64
2626

2727
// String implements the stringer interface.
2828
func (s StorageSize) String() string {
29-
if s > 1099511627776 {
29+
if s >= 1099511627776 {
3030
return fmt.Sprintf("%.2f TiB", s/1099511627776)
3131
} else if s > 1073741824 {
3232
return fmt.Sprintf("%.2f GiB", s/1073741824)
@@ -42,7 +42,7 @@ func (s StorageSize) String() string {
4242
// TerminalString implements log.TerminalStringer, formatting a string for console
4343
// output during logging.
4444
func (s StorageSize) TerminalString() string {
45-
if s > 1099511627776 {
45+
if s >= 1099511627776 {
4646
return fmt.Sprintf("%.2fTiB", s/1099511627776)
4747
} else if s > 1073741824 {
4848
return fmt.Sprintf("%.2fGiB", s/1073741824)

0 commit comments

Comments
 (0)