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 Example | 2,443 Kb |
Midas Points | 19,443 Kb |
Promises | 2,516 Kb |
Camper News | 3,013 Kb |
Zelda | 15,850 Kb |
Heavy Snake | 6,358 Kb |
Wiki Viewer | 3,476 Kb |
Midas Gift Rolls - Updating | 2,897 Kb |
Closure Examples | 2,792 Kb |
Midas - Total Multi | 5,661 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 |
WRENCH - STAFF | Lolita-adams | 1,608 Kb |
DFF Website | Hawcubite | 10,123 Kb |
A Pen by Bryan Rojas | Bryanrojas | 1,873 Kb |
Sticky Navbar | Phantomesse | 5,106 Kb |
React Markdown Previewer | C0d0er | 3,190 Kb |
CSS Flip Animation | Bbodine1 | 2,525 Kb |
Dribbble Inspired Registration Form | Lancebush | 2,358 Kb |
Mega menu | DimaZubkov | 5,066 Kb |
Basecamp 3 Document | Lachlanjc | 3,811 Kb |
Compare resources on mobile sites | Gyusza | 3,226 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!