godock: github.com/sqp/godock/libs/text/bytesize Index | Files

package bytesize

import "github.com/sqp/godock/libs/text/bytesize"

Package bytesize formats a size with units.

Index

Package Files

bytesize.go

type ByteSize Uses

type ByteSize float64

ByteSize formats size into human-readable content.

const (
    KB  ByteSize = 1 << (10 * iota)
    MB
    GB
    TB
    PB
    EB
    ZB
    YB
)

Size constants.

func (ByteSize) String Uses

func (b ByteSize) String() string

String formats the value to an usable range (1-999) with related unit. No decimal under MB, otherwise three digits are provided : 123 or 12.3 or 1.23.

Package bytesize imports 1 packages (graph) and is imported by 4 packages. Updated 2016-07-21. Refresh now. Tools for package owners.