Roman Numerals

Developer
Size
2,518 Kb
Views
22,264

How do I make an roman numerals?

What is a roman numerals? How do you make a roman numerals? This script and codes were developed by Steven on 29 September 2022, Thursday.

Roman Numerals Previews

Roman Numerals - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Roman Numerals</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <link href='https://fonts.googleapis.com/css?family=Roboto+Mono:700' rel='stylesheet' type='text/css'>
<div class="container text-center"> <h1 class="title text-center">Test Out</h1> <h3 class="thetest text-center">The Test</h3> <input type="text" class="btn-block" id="myinput" placeholder="1987" style="padding:10px;font-size:24px;text-align:center">
</div>
<div class="container cmain"> <div class="well wellmain"><p class="theresult">The Result</p></div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Roman Numerals - Script Codes CSS Codes

body { font-family: 'Roboto Mono'; font-weight: 700; letter-spacing: 2px;
}
.cmain { background: lightblue; margin-top: 20px; padding-top: 20px; border-radius: 50%;
}
.wellmain { padding-bottom: 0px; border-radius: 50%;
}
.thetest { font-size:24px;font-weight:700; color: black; border: solid black !important; background: lightgray; text-align: center; margin-bottom:20px; border-radius: 10px;
}
.theresult { font-size:24px;font-weight:700; color: black; border: solid black !important; background: lightgray; text-align: center; margin-bottom:20px; border-radius: 10px;
}

Roman Numerals - Script Codes JS Codes

function convert(num) { var result = ""; var tth = Math.floor(num % 100000 / 10000); var th = Math.floor(num % 10000 / 1000); var h = Math.floor(num % 1000 / 100); var t = Math.floor(num % 100 / 10); var u = Math.floor(num % 10); var arrNo = [u, t, h, th, tth]; var arrSym = [ ["I", "V", "X"], ["X", "L", "C"], ["C", "D", "M"], ["M", "V&#773;", "X&#773;"], ["X&#773;", "L&#773;", "C&#773;"] ]; for (var i = 0; i < 5; i++) { var t = arrNo[i]; var tmp = ""; if (t == 9) { tmp += arrSym[i][0] + arrSym[i][2]; } else if (t == 4) { tmp += arrSym[i][0] + arrSym[i][1]; } else { if (t >= 5) { tmp += arrSym[i][1]; } if (t < 4) { tmp += sym(arrSym[i][0], t); } if (t > 5) { tmp += sym(arrSym[i][0], t % 5); } } result = tmp + result; } return result;
}
function sym(symbol, num) { var result = ""; while (num--) { result += symbol; } return result;
}
var endResult = convert(1987);
$(".theresult").html("Result = " + endResult.toString());
$("#myinput").on("keyup", function() { var endResult = convert($("#myinput").val()); $(".theresult").html("Result = " + endResult.toString());
});
$(".thetest").html("Roman Numerals");
var t0 = performance.now();
for (let i=0; i<9999; i++) { convert(i)
}
var t1 = performance.now();
console.log("Call to convert took " + (t1 - t0) + " milliseconds.");
Roman Numerals - Script Codes
Roman Numerals - Script Codes
Home Page Home
Developer Steven
Username volv
Uploaded September 29, 2022
Rating 3
Size 2,518 Kb
Views 22,264
Do you need developer help for Roman Numerals?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Steven (volv) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!