https://github.com/fracpete/romannumerals4j
Tiny Java library for formatting and parsing Roman numerals.
https://github.com/fracpete/romannumerals4j
javascript parsing parsing-roman-numerals
Last synced: 2 months ago
JSON representation
Tiny Java library for formatting and parsing Roman numerals.
- Host: GitHub
- URL: https://github.com/fracpete/romannumerals4j
- Owner: fracpete
- License: other
- Created: 2016-11-20T20:32:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-12T20:06:43.000Z (over 4 years ago)
- Last Synced: 2024-10-19T12:15:55.308Z (8 months ago)
- Topics: javascript, parsing, parsing-roman-numerals
- Language: Java
- Size: 17.6 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# romannumerals4j
Tiny Java library for formatting and parsing Roman numerals, sourced from
various StackOverflow posts.Released under [CC-BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/legalcode.txt).
## Usage
### Formatting
Formatting numbers (1-3999 only):```java
import com.github.fracpete.romannumerals4j.RomanNumeralFormat;
...
RomanNumeralFormat f = new RomanNumeralFormat();
System.out.println(f.format(57));
```Outputs:
```
LVII
```### Parsing
Parsing numbers:```java
import com.github.fracpete.romannumerals4j.RomanNumeralFormat;
...
RomanNumeralFormat f = new RomanNumeralFormat();
System.out.println(f.parse("LVII"));
```Outputs:
```
57
```## Maven
Use the following dependency in your Maven project:```xml
com.github.fracpete
romannumerals4j
0.0.1```