mirror of
https://github.com/rwinkhart/convertroman.git
synced 2026-08-28 04:46:32 -04:00
Return roman numerals as lowercase strings
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
This package was adapted from [romannumeral](https://github.com/brandenc40/romannumeral) to fit my specific minimal use-case.
|
||||
|
||||
All functionality except for the ability to convert integers to roman numerals has been removed.
|
||||
All functionality except for the ability to convert integers to **lowercase** roman numerals has been removed.
|
||||
|
||||
If you need any additional functionality or further documentation, please see the original package.
|
||||
|
||||
@@ -13,9 +13,9 @@ goos: linux
|
||||
goarch: amd64
|
||||
pkg: github.com/rwinkhart/convertroman
|
||||
cpu: AMD Ryzen 9 3900X 12-Core Processor
|
||||
BenchmarkFromInt-24 62046414 21.08 ns/op 0 B/op 0 allocs/op
|
||||
BenchmarkFromInt-24 61993154 20.82 ns/op 0 B/op 0 allocs/op
|
||||
PASS
|
||||
ok github.com/rwinkhart/convertroman 1.332s
|
||||
ok github.com/rwinkhart/convertroman 1.827s
|
||||
```
|
||||
|
||||
### Example
|
||||
@@ -29,9 +29,9 @@ import (
|
||||
)
|
||||
|
||||
func ExampleFromInt() {
|
||||
roman, err := rom.FromInt(4)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
roman := FromInt(4)
|
||||
if roman == "OOB" {
|
||||
panic("Input integer is out of bounds")
|
||||
}
|
||||
fmt.Println(roman == "IV") // True
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user