Skip to content

Instantly share code, notes, and snippets.

@antonydenyer
Last active February 28, 2023 13:17
Show Gist options
  • Save antonydenyer/c115e4213a54677209c87ac4f2ad718c to your computer and use it in GitHub Desktop.
Save antonydenyer/c115e4213a54677209c87ac4f2ad718c to your computer and use it in GitHub Desktop.

DecimalToRoman

Problem description

The Kata says you should write a function to convert from Decimals to Roman numerals. In order to keep the kata light, we will not check for valid Roman Numeral.

Roman numerals, the numeral system of ancient Rome, uses combinations of letters from the Latin alphabet to signify values. They are based on seven symbols:

Value Symbol
1 I
5 V
10 X
50 L
100 C
500 D
1000 M

Numbers are formed by combining symbols together and adding the values. Generally, symbols are placed in order of value, starting with the largest values. When smaller values precede larger values, the smaller values are subtracted from the larger values, and the result is added to the total.

Example:

Roman Number Value
MMVI 2006
MCMXLIV 1944
@antonydenyer
Copy link
Author

@apolo49
Copy link

apolo49 commented Feb 28, 2023

To prevent exposure to insecure links it's probably better to use this instead: https://wiki.imperivm-romanvm.com/wiki/Roman_Numerals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment