unit

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const HumanBasePower = 3

Variables

This section is empty.

Functions

func ParseBase

func ParseBase(num, scale float64, r radix.Radix) (humanNumber, humanBase float64, err error)

Types

type Unit

type Unit int
const (
	One Unit = 3 * iota
	Kilo
	Mega
	Giga
	Tera
	Peta
	Exa
	Zetta
	Yotta
	Bronto
	Geop
	Ten           = 1
	Hundred       = 2
	Unimplemented = -1 //Unimplemented Unit
)

power

func New

func New(tag string) (Unit, error)

num 123kb tag is k

func NewFromBase

func NewFromBase(base float64, r radix.Radix) (Unit, error)

func NewFromPower

func NewFromPower(power int64) Unit

func (Unit) Base

func (u Unit) Base(decimal bool) (int64, error)

get base number

func (Unit) BaseFromRadix

func (u Unit) BaseFromRadix(r radix.Radix) (int64, error)

func (Unit) String

func (u Unit) String() (string, error)

func (Unit) Valid

func (u Unit) Valid() (bool, error)

Jump to

Keyboard shortcuts

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