Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wzshiming/romanumeral
Roman numerals in Go
https://github.com/wzshiming/romanumeral
numeral numerals roman roman-numerals
Last synced: 8 days 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 (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-12T12:30:09.000Z (almost 5 years ago)
- Last Synced: 2024-06-20T06:28:56.117Z (5 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[![Go Report Card](https://goreportcard.com/badge/github.com/wzshiming/romanumeral)](https://goreportcard.com/report/github.com/wzshiming/romanumeral)
[![GoDoc](https://godoc.org/github.com/wzshiming/romanumeral?status.svg)](https://godoc.org/github.com/wzshiming/romanumeral)
[![GitHub license](https://img.shields.io/github/license/wzshiming/romanumeral.svg)](https://github.com/wzshiming/romanumeral/blob/master/LICENSE)
[![gocover.io](https://gocover.io/_badge/github.com/wzshiming/romanumeral)](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.