package cast

import "github.com/gohugoio/hugo/tpl/cast"

Package cast provides template functions for data type conversions.

Index

Package Files

cast.go docshelper.go init.go

type Namespace

type Namespace struct {
}

Namespace provides template functions for the "cast" namespace.

func New

func New() *Namespace

New returns a new instance of the cast-namespaced template functions.

func (*Namespace) ToFloat

func (ns *Namespace) ToFloat(v any) (float64, error)

ToFloat converts v to a float.

func (*Namespace) ToInt

func (ns *Namespace) ToInt(v any) (int, error)

ToInt converts v to an int.

func (*Namespace) ToString

func (ns *Namespace) ToString(v any) (string, error)

ToString converts v to a string.

Version
v0.101.0 (latest)
Published
Jun 16, 2022
Platform
linux/amd64
Imports
9 packages (graph)
Last checked
3 hours ago

Tools for package owners.