utils

package
v0.0.0-...-dafc34e Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnitConverter

type UnitConverter struct {
	// contains filtered or unexported fields
}

UnitConverter is a utility for converting between units.

func NewUnitConverter

func NewUnitConverter(dao *daos.Dao) (*UnitConverter, error)

NewUnitConverter creates a new unit converter.

func (*UnitConverter) Convert

func (uc *UnitConverter) Convert(value float64, from, into string) (float64, error)

Convert converts a value from one unit to another. TODO(nmcapule): Do a BFS unit conversion implementation.

func (*UnitConverter) Refresh

func (uc *UnitConverter) Refresh(dao *daos.Dao) error

Refresh refreshes the unit conversion table.

Jump to

Keyboard shortcuts

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