Package ord provides tools for turning numbers into their human-friendly ordinal representation.
Go to file
Charles Iliya Krempeaux 30f8468f8b correction 2023-10-27 11:32:37 -07:00
en initial commits 2023-03-01 09:49:56 -08:00
LICENSE initial commits 2023-03-01 09:45:05 -08:00
README.md correction 2023-10-27 11:32:37 -07:00
go.mod go.mod 2023-10-06 10:23:00 -07:00

README.md

go-ord

Package ord provides tools for turning numbers into their human-friendly ordinal representation.

For example:

Number (English) Ordinal
1 1st
2 2nd
3 3rd
4 4th
5 5th
... ...
20 20th
21 21st
22 22nd
23 23rd
24 24th
25 25th
26 26th
27 27th
... ...

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-ord

GoDoc

Example:

import "sourcecode.social/reiver/go-ord/en"

// ...

var n int64 = 123

fmt.Printf("You are the %s person in line.", orden.FormatInt64(n))

// Output:
// You are the 123rd person in line.

Import

To import package ord use import code like the follownig:

import "sourcecode.social/reiver/go-ord"

Installation

To install package ord do the following:

GOPROXY=direct go get https://sourcecode.social/reiver/go-ord

Author

Package ord was written by Charles Iliya Krempeaux