LGMRomanNumber is an iOS library to convert arabic numbers to/from roman numbers.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LGMRomanNumber.xcodeproj
LGMRomanNumber
LGMRomanNumberTests
.gitignore
LICENSE
README.md

README.md

LGMRomanNumber

LGMRomanNumber is an iOS library to convert arabic numbers to/from roman numbers.

Description

This library provides a convinient way to convert arabic numbers to roman numbers and vice versa. It also validates that the input values are valid and throws exceptions if not. All the rules and specific cases are applied when converting to roman numbers, see Wikipedia for more details. Converting arabic values in interval [1, 4000] or roman numbers in interval [I, MMMM];

Usage

You just have to #import "LGMRomanNumber.h" to be able to use it.

NSString *romanNumber = [LGMRomanNumber romanFromArabic:1986];
// romanNumber value is MCMLXXXVI

NSUInteger arabicNumber = [LGMRomanNumber arabicFromRoman:@"MMXIII"];
// arabicNumber value is 2013

Credits

LGMRomanNumber was created by Ludovic Landry.

Creator

Ludovic Landry
@ludoviclandry

License

LGMRomanNumber is available under the MIT license. See the LICENSE file for more info.