added examples

This commit is contained in:
Branden
2021-02-07 15:19:37 -06:00
parent 676cdcecbe
commit ffcc16a44f
2 changed files with 38 additions and 1 deletions
+20
View File
@@ -1 +1,21 @@
# 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")
}
```