An open API service indexing awesome lists of open source software.

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.

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

```