utils

package
v0.0.0-...-0b3c072 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DecimalRegex = `[-+]?(\d*\.)?\d+(e[-+]?\d+)?`
	Separator    = "#"
)

Variables

This section is empty.

Functions

func ParseRange

func ParseRange(literal string) ([]*float64, error)

Types

type Operation

type Operation struct {
	Operator string
	Operand  float64
}

type Operations

type Operations []Operation

func NewOperations

func NewOperations(literal string) (Operations, error)

func (Operations) Convert

func (operations Operations) Convert(value float64) float64

func (Operations) Revert

func (operations Operations) Revert(value float64) float64

type Units

type Units struct {
	Name       string
	Operations Operations
}

func ParseUnits

func ParseUnits(literal string, globalUnits map[string]Operations) (Units, error)

Jump to

Keyboard shortcuts

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