Return roman numerals as lowercase strings

This commit is contained in:
2024-10-25 16:26:43 -04:00
parent 0846ed7063
commit 6278fde12d
3 changed files with 26 additions and 26 deletions
+6 -6
View File
@@ -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
}