humanize

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ordinal

func Ordinal(x int) string

Ordinal gives you the input number in a rank/ordinal format.

Ordinal(3) -> 3rd

func Pluralize

func Pluralize(quantity int, singular, plural string) string

Pluralize returns the quantity then either the `singular` (fox) or `plural` (foxes) depending on that given `quantity` e.g. `Pluralize(2, "fox", "foxes")` returns "2 foxes"

Example
fmt.Println(Pluralize(2, "fox", "foxes"))
Output:

2 foxes

func RoughDuration added in v1.0.0

func RoughDuration(d time.Duration) string

RoughDuration returns a rough duration as a number of minutes, hours or days, for example "2 minutes", "11 days"

Types

This section is empty.

Jump to

Keyboard shortcuts

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