convutil

package
v1.5.45 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2018 License: MIT Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConvertRoundToPlaces = 6

Functions

func Convert

func Convert(in interface{}, from interface{}, to interface{}) (float64, error)

func ExactConvert

func ExactConvert(in interface{}, from interface{}, to interface{}) (float64, error)

func MustConvert

func MustConvert(in interface{}, from interface{}, to interface{}) float64

func MustExactConvert

func MustExactConvert(in interface{}, from interface{}, to interface{}) float64

Types

type Unit

type Unit int
const (
	Invalid Unit = iota
	AU
	Celsius
	Fahrenheit
	Feet
	Kelvin
	KilometersPerHour
	Lightseconds
	Lightminutes
	Lightyears
	Meters
	MetersPerSecond
	Miles
	MilesPerHour
	NauticalMiles
)

func MustParseUnit

func MustParseUnit(unit string) Unit

func ParseUnit

func ParseUnit(unit string) (Unit, error)

func (Unit) Family

func (self Unit) Family() UnitFamily

func (Unit) IsValid

func (self Unit) IsValid() bool

func (Unit) LongString

func (self Unit) LongString() string

func (Unit) String

func (self Unit) String() string

type UnitFamily

type UnitFamily int
const (
	GeneralUnits UnitFamily = iota
	TemperatureUnits
	LengthUnits
	SpeedUnits
	AbsoluteUnit = math.MaxInt64
)

Jump to

Keyboard shortcuts

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