72ea1735360d134f4fce002b09d0d0394c36ee37
[JavaForFun] /
1 package org.craftedsw.romannumerals;
2
3 public class RomanNumeralGenerator {
4
5         public static String romanFor(int decimal) {
6                 String roman = "";
7                 if (decimal == 10) {
8                         roman += "X";
9                         decimal -= 10;
10                 }
11                 if (decimal >= 5) {
12                         roman += "V";
13                         decimal -= 5;
14                 }
15                 for (int i = 0; i < decimal; i++) {
16                         roman  += "I";
17                 }
18                 
19                 return roman;
20         }
21
22 }