Documentation
¶
Index ¶
- type Namespace
- func (ns *Namespace) Add(i ...interface{}) int64
- func (ns *Namespace) Ceil(i interface{}) float64
- func (ns *Namespace) Divide(a, b interface{}) (int64, error)
- func (ns *Namespace) Floor(i interface{}) float64
- func (ns *Namespace) Max(a interface{}, i ...interface{}) int64
- func (ns *Namespace) Min(a interface{}, i ...interface{}) int64
- func (ns *Namespace) Modulus(a, b interface{}) (int64, error)
- func (ns *Namespace) Multiply(a interface{}, i ...interface{}) int64
- func (ns *Namespace) Round(i interface{}) float64
- func (ns *Namespace) Subtract(a, b interface{}) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace defines the methods for math to be used as template functions.
func (*Namespace) Add ¶
Add
Returns a range of numbers that have been added in `int64`
Example: {{ add 2 2 }} Returns: `4`
func (*Namespace) Ceil ¶
Ceil
Rounds up to the nearest float value, returns `float 64`
Example: {{ ceil 9.32 }} Returns: `10`
func (*Namespace) Divide ¶
Divide
Returns divided numbers in `int64`
Example: {{ divide 16 4 }} Returns: `4`
func (*Namespace) Floor ¶
Floor
Rounds down to the nearest float value , returns `float 64`
Example: {{ floor 9.62 }} Returns: `9`
func (*Namespace) Max ¶
Max
Finds the largest numeric value in a slice of numbers, returns `int64`
Example: {{ max 20 1 100 }} Returns: `100`
func (*Namespace) Min ¶
Min
Finds the smallest numeric value in a slice of numbers, returns `int64`
Example: {{ min 20 1 100 }} Returns: `1`
func (*Namespace) Modulus ¶
Modulus
Returns remainder of two numbers in `int64`
Example: {{ mod 10 9 }} Returns: `1`
func (*Namespace) Multiply ¶
Multiply
Returns a range of numbers that have been multiplied in `int64`
Example: {{ multiply 4 4 }} Returns: `16`