lang

package
v0.32.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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 provides template functions for the "lang" namespace.

func New

func New(deps *deps.Deps) *Namespace

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

func (*Namespace) NumFmt

func (ns *Namespace) NumFmt(precision, number interface{}, options ...interface{}) (string, error)

NumFmt formats a number with the given precision using the negative, decimal, and grouping options. The `options` parameter is a string consisting of `<negative> <decimal> <grouping>`. The default `options` value is `- . ,`.

Note that numbers are rounded up at 5 or greater. So, with precision set to 0, 1.5 becomes `2`, and 1.4 becomes `1`.

func (*Namespace) Translate

func (ns *Namespace) Translate(id interface{}, args ...interface{}) (string, error)

Translate ...

Jump to

Keyboard shortcuts

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