Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1.13 KB

README.md

File metadata and controls

35 lines (22 loc) · 1.13 KB

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.