Roman Numerals
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 - 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̅", "X̅"], ["X̅", "L̅", "C̅"] ]; 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.");
Developer | Steven |
Username | volv |
Uploaded | September 29, 2022 |
Rating | 3 |
Size | 2,518 Kb |
Views | 22,264 |
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!
Name | Size |
Closure Examples | 2,792 Kb |
Closure Example | 2,443 Kb |
Midas Points | 19,443 Kb |
Weather | 4,445 Kb |
Squares Within Range | 2,853 Kb |
Reddit Spoiler Markdown | 2,077 Kb |
JSRange | 3,245 Kb |
Recursive Multiplication | 2,119 Kb |
Pet Stats | 10,939 Kb |
Wiki Viewer | 3,476 Kb |
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!
Name | Username | Size |
After America | Jonathangarner | 2,686 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
FontAwesome icons with animation | Nicotinell | 2,083 Kb |
Nested table email layout | Massimo-cassandro | 2,355 Kb |
Placeholder support for contentEditable elements, without JavaScript | Flesler | 1,863 Kb |
Loader | MikitaLisavets | 3,321 Kb |
A Pen by John Malc | F789gh | 1,420 Kb |
Octopus Bar iPad App Interactions | Davidkpiano | 6,735 Kb |
CSS3 keyframe onload animation. | Samueljseay | 1,706 Kb |
The CodePen Logo | Kindofone | 4,259 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!