Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sample 2: Display number row in roman numerals

Image RemovedImage Added

Figure 6:  Example input 2 in the Script property.

Code Block
languagejava
titleCode Block
int decimalNumber = index + 1;

int[] values = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
String[] romanLetters = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};

StringBuilder romanNumber = new StringBuilder();

for(int i = 0; i<valuesi < values.length; i++){  
    while(decimalNumber >= values[i]){
        decimalNumber = decimalNumber - values[i];
        romanNumber.append(romanLetters[i]);
    }
}

return romanNumber;

...

Sample 3: Display number row with conditional prefix

Image RemovedImage Added

Figure 8: Example input 3 in the Script property.

...