Documentation ¶
Index ¶
- Constants
- Variables
- func Convert(in interface{}, from interface{}, to interface{}) (float64, error)
- func ExactConvert(in interface{}, from interface{}, to interface{}) (float64, error)
- func MustConvert(in interface{}, from interface{}, to interface{}) float64
- func MustExactConvert(in interface{}, from interface{}, to interface{}) float64
- type Bytes
- type SIExponents
- type Unit
- type UnitFamily
Constants ¶
View Source
const ( Quetta SIExponents = 30 Ronna = 27 Yotta = 24 Zetta = 21 Exa = 18 Peta = 15 Tera = 12 Giga = 9 Mega = 6 Kilo = 3 Hecto = 2 Deca = 1 Deci = -1 Centi = -2 Milli = -3 Micro = -6 Nano = -9 Pico = -12 Femto = -15 Atto = -18 Zepto = -21 Yocto = -24 Ronto = -27 Quecto = -30 )
Variables ¶
View Source
var ConvertRoundToPlaces = 6
Functions ¶
func ExactConvert ¶
func MustConvert ¶
func MustConvert(in interface{}, from interface{}, to interface{}) float64
func MustExactConvert ¶
func MustExactConvert(in interface{}, from interface{}, to interface{}) float64
Types ¶
type Bytes ¶ added in v1.6.22
type Bytes float64
const ( Byte Bytes = 1 Kilobyte Bytes = 1024 Megabyte Bytes = 1048576 Gigabyte Bytes = 1073741824 Terabyte Bytes = 1099511627776 Petabyte Bytes = 1125899906842624 Exabyte Bytes = 1152921504606846976 Zettabyte Bytes = 1180591620717411303424 Yottabyte Bytes = 1208925819614629174706176 Brontobyte Bytes = 1237940039285380274899124224 // unofficial Ronnabyte Bytes = 1237940039285380274899124224 Quettabyte Bytes = 1267650600228229401496703205376 )
type SIExponents ¶ added in v1.6.22
type SIExponents int
type Unit ¶
type Unit int
func MustParseUnit ¶
func (Unit) Family ¶
func (self Unit) Family() UnitFamily
func (Unit) LongString ¶
type UnitFamily ¶
type UnitFamily int
const ( GeneralUnits UnitFamily = iota TemperatureUnits LengthUnits SpeedUnits )
Click to show internal directories.
Click to hide internal directories.