unit

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package unit provides some helpful unit conversions

Index

Constants

View Source
const (
	Kibibyte = 1024
	KiB      = Kibibyte
	Mebibyte = Kibibyte * 1024
	MiB      = Mebibyte
	Gibibyte = Mebibyte * 1024
	GiB      = Gibibyte
	Tebibyte = Gibibyte * 1024
	TiB      = Tebibyte
)

Variables

This section is empty.

Functions

func HumanBase2

func HumanBase2(val int64) (result string)

HumanBase2 converts the given value in bytes to a human readable format e.g. 3195728 = 3.05 MiB

func ToGiB

func ToGiB(val int64) (gib float64)

ToGiB converts the given value in bytes to increments of GiB

func ToKiB

func ToKiB(val int64) (kib float64)

ToKiB converts the given value in bytes to increments of KiB

func ToMiB

func ToMiB(val int64) (mib float64)

ToMiB converts the given value in bytes to increments of MiB

func ToTiB

func ToTiB(val int64) (tib float64)

ToTiB converts the given value in bytes to increments of TiB

Types

This section is empty.

Jump to

Keyboard shortcuts

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