mirror of
https://github.com/rwinkhart/convertroman.git
synced 2026-08-28 12:56:27 -04:00
ec567ba35dd711546c2602edd1e208b4e1bcb521
Go Roman Numerals
Convert to and from roman numerals in Go.
package main
import (
"fmt"
"github.com/brandenc40/romannumeral"
)
func ExampleToInt() {
integer, err := romannumeral.ToInt("IV")
if err != nil {
panic(err)
}
fmt.Println(integer == 4)
}
func ExampleFromInt() {
roman, err := romannumeral.FromInt(4)
if err != nil {
panic(err)
}
fmt.Println(roman == "IV")
}
Languages
Go
100%