units

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package units contains helpers to convert sizes to humand-readable strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitsPerSecondsString

func BitsPerSecondsString(bps float64) string

BitsPerSecondsString formats the given value bits per second with the appropriate suffix (Kbit/s, Mbit/s, Gbit/s, ...)

func BytesStringBase10

func BytesStringBase10(b int64) string

BytesStringBase10 formats the given value as bytes with the appropriate base-10 suffix (KB, MB, GB, ...)

func BytesStringBase2

func BytesStringBase2(b int64) string

BytesStringBase2 formats the given value as bytes with the appropriate base-2 suffix (KiB, MiB, GiB, ...)

func Count

func Count(v int64) string

Count returns the given number with the appropriate base-10 suffix (K, M, G, ...)

Types

This section is empty.

Jump to

Keyboard shortcuts

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