mirror of
https://github.com/rwinkhart/convertroman.git
synced 2026-08-29 13:26:28 -04:00
22 lines
301 B
Markdown
22 lines
301 B
Markdown
# Go Roman Numerals
|
|
|
|
Convert to and from roman numerals in Go.
|
|
|
|
```go
|
|
func ExampleToInt() {
|
|
integer, err := ToInt("IV")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(integer == 4)
|
|
}
|
|
|
|
func ExampleFromInt() {
|
|
roman, err := FromInt(4)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
fmt.Println(roman == "IV")
|
|
}
|
|
```
|