format

package
v0.0.0-...-3c8687b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KibiByte
	MebiByte
	GibiByte
	TebiByte
	PebiByte
	ExbiByte
)

binary

View Source
const (
	KiloByte = 1000 * Byte
	MegaByte = 1000 * KiloByte
	GigaByte = 1000 * MegaByte
	TeraByte = 1000 * GigaByte
	PetaByte = 1000 * TeraByte
	ExaByte  = 1000 * PetaByte
)

decimal

View Source
const (
	Nanosecond uint64 = 1

	Microsecond = 1000 * Nanosecond
	Millisecond = 1000 * Microsecond
	Second      = 1000 * Millisecond

	Minute = 60 * Second
	Hour   = 60 * Minute
)

seconds

View Source
const Byte uint64 = 1

Byte is just one byte.

Variables

This section is empty.

Functions

func FmtBytes

func FmtBytes(bytes uint64, longUnit, useDecimal bool) string

FmtBytes returns the string representation of bytes size with auto unit.

func FmtBytesUnit

func FmtBytesUnit(bytes uint64, unit uint64, longUnit bool) string

FmtBytesUnit returns the string representation of bytes size with unit.

Types

This section is empty.

Jump to

Keyboard shortcuts

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