convert

package
v0.0.0-...-2561dba Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the prefix given to all the functions in this module.
	ModuleName = "convert"
)

Variables

This section is empty.

Functions

func FormatBool

func FormatBool(ctx context.Context, input []types.Value) (types.Value, error)

FormatBool converts a boolean to a string representation that can be consumed by ParseBool. This value will be `"true"` or `"false"`.

func IntToStr

func IntToStr(ctx context.Context, input []types.Value) (types.Value, error)

IntToStr converts an integer to a string.

func ParseBool

func ParseBool(ctx context.Context, input []types.Value) (types.Value, error)

ParseBool parses a bool string and returns a boolean. It errors if you pass it an invalid value. Valid values match what is accepted by the golang strconv.ParseBool function. It's recommended to use the strings `true` or `false` if you are undecided about what string representation to choose.

func ToFloat

func ToFloat(ctx context.Context, input []types.Value) (types.Value, error)

ToFloat converts an integer to a float.

func ToInt

func ToInt(ctx context.Context, input []types.Value) (types.Value, error)

ToInt converts a float to an integer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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