sConv

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValueTypes = map[string]ValueType{
	"bool":   {"Boolean", `type="checkbox" value="0"`},
	"float":  {"Float", `type="number" step="0.01" min="0.00" value="0.00"`},
	"int":    {"Integer", `type="number" min="0" value="0"`},
	"string": {"String", `type="text" value=""`},
}

Functions

func Compare

func Compare(op, v1, v2, vType string) bool

Compare is "true" if (v1 "op" v2)

func CompareFloats added in v0.4.0

func CompareFloats(v1, v2 float64, prec int) int

func ComparePrecFloat

func ComparePrecFloat(v1, v2 float64, prec int) float64

ComparePrecFloat, "v1>v2: >0", "v1<v2: <0", "v1=v2: 0"

func CompareTruncFloat

func CompareTruncFloat(v1, v2 float64, prec int) float64

CompareTruncFloat, "v1>v2: >0", "v1<v2: <0", "v1=v2: 0"

func GetBool

func GetBool(str string) bool

func GetDiffAbs

func GetDiffAbs(fromValue, toValue float64) float64

func GetDiffPercent

func GetDiffPercent(fromValue, toValue float64) float64

func GetDiffPercentAbs

func GetDiffPercentAbs(fromValue, toValue float64) float64

func GetFloat

func GetFloat(str string) float64

func GetFloatInterface

func GetFloatInterface(i interface{}) (f float64)

func GetInt

func GetInt(str string) int

func GetInt64

func GetInt64(str string) int64

func GetPrecFloat

func GetPrecFloat(value float64, prec int) float64

func GetStrArrF

func GetStrArrF(vs []float64) string

func GetStrB

func GetStrB(v bool) string

func GetStrF

func GetStrF(v float64) string

func GetStrI

func GetStrI(v int) string

func GetStrI64

func GetStrI64(v int64) string

func GetStrPrecF

func GetStrPrecF(v float64, prec int) string

func GetTruncFloat

func GetTruncFloat(value float64, prec int) float64

func GetValues

func GetValues(str, vType string) []string

func GetWithPercent

func GetWithPercent(value, percent float64, adding bool) float64

Adding or Subtracting percent to value

Types

type ExtValues

type ExtValues struct {
	V_1 string
	V_2 string
	// contains filtered or unexported fields
}

func GetRangeLimits

func GetRangeLimits(str, vType string) []ExtValues

type F

type F struct{}

func (F) RemoveIndex

func (F) RemoveIndex(slice []float64, index int) []float64

func (F) RemoveValue

func (F) RemoveValue(slice []float64, value float64) []float64

type I

type I struct{}

type ValueType

type ValueType struct {
	Text string
	Html string
}

Jump to

Keyboard shortcuts

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