https://github.com/wzshiming/romanumeral
Roman numerals in Go
https://github.com/wzshiming/romanumeral
numeral numerals roman roman-numerals
Last synced: about 2 months ago
JSON representation
Roman numerals in Go
- Host: GitHub
- URL: https://github.com/wzshiming/romanumeral
- Owner: wzshiming
- License: mit
- Created: 2019-08-12T08:15:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-12T12:30:09.000Z (over 5 years ago)
- Last Synced: 2025-02-09T05:18:56.193Z (3 months ago)
- Topics: numeral, numerals, roman, roman-numerals
- Language: Go
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# romanumeral
Roman numerals in Go[](https://goreportcard.com/report/github.com/wzshiming/romanumeral)
[](https://godoc.org/github.com/wzshiming/romanumeral)
[](https://github.com/wzshiming/romanumeral/blob/master/LICENSE)
[](https://gocover.io/github.com/wzshiming/romanumeral)## Install
``` shell
go get -u -v github.com/wzshiming/romanumeral
```## Example
``` golang
func TestRoman(t *testing.T) {
for i := Roman(1); i != 4000; i++ {
tmp, err := i.EncodeToString()
if err != nil {
t.Error(err)
}
var d Roman
off, err := d.DecodeString(tmp)
if err != nil {
t.Error(err)
}
if d != i {
t.Fatal(int(i), d, i, off, tmp)
}
}
}
```## License
Pouch is licensed under the MIT License. See [LICENSE](https://github.com/wzshiming/romanumeral/blob/master/LICENSE) for the full license text.