Numbers to Roman Numerals Converter Online Tool
About Numbers to Roman Numerals Converter Online Tool:
This online Roman Numerals to Numbers Converter helps you to convert one Roman Numeral into a number (base 10). Put Roman Numeral into the first textbox, the number result will show in the second textbox.
Roman Numerals:
Roman numerals is invented by ancient Rome, it use letters from Latin ("I" for "1", "V" for "5", "X" for "10", "L" for "50", "C" for "100", "D" for "500", "M" for "1000")
to represent numbers. Roman
numerals is still widely used in academic paper chapter numbering system.
How to convert from Numbers to Roman Numerals?
Step 1: Remember the value combination list
["M": 1000, "CM": 900, "D": 500, "CD": 400, "C": 100, "XC": 90, "L": 50, "XL": 40, "X": 10, "IX": 9, "V": 5, "IV": 4, "I": 1]
, Remember its order and each value.Step 2: From left to right, subtract as much large combination as you can, unless it's not smaller than 0.
Example 1: Convert Number "424" to Roman Numeral:
Example 2: Convert Number "2019" to Roman Numeral:
Numbers to Roman Numerals conversion table:
Numbers | Roman Numerals | Numbers | Roman Numerals |
---|---|---|---|
1 | I | 21 | XXI |
2 | II | 22 | XXII |
3 | III | 23 | XXIII |
4 | IV | 24 | XXIV |
5 | V | 25 | XXV |
6 | VI | 26 | XXVI |
7 | VII | 27 | XXVII |
8 | VIII | 28 | XXVIII |
9 | IX | 29 | XXIX |
10 | X | 30 | XXX |
11 | XI | 31 | XXXI |
12 | XII | 32 | XXXII |
13 | XIII | 33 | XXXIII |
14 | XIV | 34 | XXXIV |
15 | XV | 35 | XXXV |
16 | XVI | 36 | XXXVI |
17 | XVII | 37 | XXXVII |
18 | XVIII | 38 | XXXVIII |
19 | XIX | 39 | XXXIX |
20 | XX | 40 | XL |
More information:
Wikipedia (Roman numerals): https://en.wikipedia.org/wiki/Roman_numerals
Convert Numbers to Roman Numerals with Python:
def transform_number_to_roman_numeral(number): roman_value_list = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1] roman_char_list = ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"] res = '' for i in range(len(roman_value_list)): while number >= roman_value_list[i]: number -= roman_value_list[i] res += roman_char_list[i] return res number_input = 987 roman_numeral_output = transform_number_to_roman_numeral(number_input) print('number {0} equal to:{1}'.format(number_input, roman_numeral_output)) ------------------- number 987 equal to:CMLXXXVII
Convert Numbers to Roman Numerals with Java:
public class NumberConvertManager { public static String transform_number_to_roman_numeral(int number) { int[] roman_value_list = new int[]{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; String[] roman_char_list = new String[]{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"}; StringBuilder res = new StringBuilder(); for (int i = 0; i < roman_value_list.length; i += 1) { while (number >= roman_value_list[i]){ number -= roman_value_list[i]; res.append(roman_char_list[i]); } } return res.toString(); } public static void main(String[] args) { int number_input = 987; String roman_numeral_output = transform_number_to_roman_numeral(number_input); System.out.println("number " + number_input + " equal to:" + roman_numeral_output); } } ------------------- number 987 equal to:CMLXXXVII