datasize

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter struct{}

Converter manages CLI

Example
var output string
cnv := &Converter{}

output = cnv.HumanReadable(1)
fmt.Println(output)
output = cnv.HumanReadable(1024)
fmt.Println(output)
output = cnv.HumanReadable(1025)
fmt.Println(output)
output = cnv.HumanReadable(4096)
fmt.Println(output)
output = cnv.HumanReadable(2345246256)
fmt.Println(output)
output = cnv.HumanReadable(404235234234596)
fmt.Println(output)
Output:

1 B
1024 B
1.0 KB
4.0 KB
2.2 GB
367.6 TB

func (*Converter) HumanReadable

func (c *Converter) HumanReadable(size uint64) string

HumanReadable converts datasize into Human readable format

Jump to

Keyboard shortcuts

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