numbers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2016 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const MinValue = 1

MinValue is the min number which should be converted

View Source
const RomanStringMatcher = "^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$"

RomanStringMatcher is a regex to check if string is a roman number

Variables

This section is empty.

Functions

func FromRoman

func FromRoman(input string) (int, error)

FromRoman converts a roman string to an integer. Returns an error if string is not a roman number.

func Ordinal

func Ordinal(number int) string

Ordinal returns the ordinal string for a specific integer.

func Ordinalize

func Ordinalize(number int) string

Ordinalize the number by adding the Ordinal to the number.

func ToRoman

func ToRoman(number int) (string, error)

ToRoman converts a number to a roman string. Number has to be higher than MinValue

Types

This section is empty.

Jump to

Keyboard shortcuts

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