Moved ethutil => common
This commit is contained in:
15
common/size.go
Normal file
15
common/size.go
Normal file
@ -0,0 +1,15 @@
|
||||
package common
|
||||
|
||||
import "fmt"
|
||||
|
||||
type StorageSize float64
|
||||
|
||||
func (self StorageSize) String() string {
|
||||
if self > 1000000 {
|
||||
return fmt.Sprintf("%.2f mB", self/1000000)
|
||||
} else if self > 1000 {
|
||||
return fmt.Sprintf("%.2f kB", self/1000)
|
||||
} else {
|
||||
return fmt.Sprintf("%.2f B", self)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user