bytesize

package
v0.0.0-...-0caaa62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 1 Imported by: 0

Documentation

Overview

Package bytesize formats a size with units.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSize

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL