mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-24 12:37:16 +00:00
16 lines
286 B
Go
16 lines
286 B
Go
package ethutil
|
|
|
|
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)
|
|
}
|
|
}
|