Answers for "roman numerals converter table embed"

0

roman numerals converter table embed

const inputField = document.querySelector('input'); // input element
const convertButton = document.getElementById('convert'); // convert button
const outputField = document.getElementById('display'); // output element
Posted by: Guest on August-25-2020
0

roman numerals converter table embed

function convertToRoman() {
  let arabic = document.getElementById('arabicNumeral').value; // input value
  let roman = '';  // variable that will hold the result
}
Posted by: Guest on August-25-2020
0

roman numerals converter table embed

if (/^(0|[1-9]\d*)$/.test(arabic)) {
  // Regular expression tests
  if (arabic == 0) {
    // for decimal points and negative
    outputField.innerHTML = "Nulla"; // signs
  } else if (arabic != 0) {
    for (let i = 0; i < arabicArray.length; i++) {
      while (arabicArray[i] <= arabic) {
        roman += romanArray[i];
        arabic -= arabicArray[i];
      }
    }
    outputField.innerHTML = roman;
  }
} else {
  outputField.innerHTML =
    "Please enter non negative integers only. No decimal points.";
}
Posted by: Guest on August-25-2020

Code answers related to "roman numerals converter table embed"

Browse Popular Code Answers by Language