mirror of
https://github.com/rwinkhart/convertroman.git
synced 2026-09-05 08:27:21 -04:00
updated example in readme
This commit is contained in:
@@ -3,8 +3,15 @@
|
|||||||
Convert to and from roman numerals in Go.
|
Convert to and from roman numerals in Go.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/brandenc40/romannumeral"
|
||||||
|
)
|
||||||
|
|
||||||
func ExampleToInt() {
|
func ExampleToInt() {
|
||||||
integer, err := ToInt("IV")
|
integer, err := romannumeral.ToInt("IV")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
@@ -12,7 +19,7 @@ func ExampleToInt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ExampleFromInt() {
|
func ExampleFromInt() {
|
||||||
roman, err := FromInt(4)
|
roman, err := romannumeral.FromInt(4)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user