Skip to content

fracpete/romannumerals4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

romannumerals4j

Tiny Java library for formatting and parsing Roman numerals, sourced from various StackOverflow posts.

Released under CC-BY-SA 3.0.

Usage

Formatting

Formatting numbers (1-3999 only):

import com.github.fracpete.romannumerals4j.RomanNumeralFormat;
...
RomanNumeralFormat f = new RomanNumeralFormat();
System.out.println(f.format(57));

Outputs:

LVII

Parsing

Parsing numbers:

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:

<dependency>
    <groupId>com.github.fracpete</groupId>
    <artifactId>romannumerals4j</artifactId>
    <version>0.0.1</version>
</dependency>

About

Tiny Java library for formatting and parsing Roman numerals.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages