Documentation ¶
Index ¶
Constants ¶
const ( I = iota V X )
These constants are the building blocks for the main algorithm, and are used as indexes into Symbols.
Variables ¶
var OVERLINE = "\xCC\x85"
OVERLINE are the combining characters for the overline.
var Symbols = []string{ "I", "V", "X", "L", "C", "D", "M", OVERLINE + "V", OVERLINE + "X", OVERLINE + "L", OVERLINE + "C", OVERLINE + "D", OVERLINE + "M", "", "", }
Symbols maps each position with the symbols it may have.
var Values = map[byte]uint32{
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D': 500,
'M': 1000,
}
Values maps each string in a roman numeral to its numeric value.
Functions ¶
func FromArabic ¶
FromArabic converts an arabic integer into a roman numeral string. All conversions are digitwise.
func FromArabicString ¶
FromArabicString is a convenience method that parses the arabic numeral from a string and then calls FromArabic.
func GetSymbols ¶
GetSymbols returns the 3 symbols that could possibly be used to represent a number
func ToArabicString ¶
ToArabicString is a convenience method that calls toArabic, and then converts the return result into a string
Types ¶
This section is empty.