Calculator Tools Calculator Tools
Create

Inches to MM Calculator

Nov 11, 2023

About this app

A calculator that converts inches to millimeters and divides the result by 160.

Inches to MM Calculator Inches to MM Calculator Inches: Result:

Related apps

Put this on your site

Source

                    <html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Inches to MM Calculator</title>
<meta name="description" content="A calculator that converts inches to millimeters and divides the result by 160.">
<meta name="keywords" content="inches, millimeters, calculator">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.

// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
// Get the input element
var inchesInput = document.getElementById("inches-input");
// Get the result element
var resultElement = document.getElementById("result");

// Add event listener to the input element
inchesInput.addEventListener("input", function() {
// Get the value in inches
var inches = parseFloat(inchesInput.value);

// Convert inches to millimeters divided by 160
var mm = inches * 25.4;
var result = mm / 160;

// Update the result element
resultElement.innerText = result.toFixed(2);
});
});

} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>

<style>
/* App CSS Goes Here */
.container {
max-width: 500px;
margin: 0 auto;
}

.input-group {
margin-bottom: 20px;
}

.input-group-text {
font-size: 20px;
background-color: #f8f9fa;
border: none;
}

.form-control {
font-size: 20px;
}

.result {
font-size: 24px;
font-weight: bold;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1 class="text-center mb-4">Inches to MM Calculator</h1>

<div class="input-group">
<span class="input-group-text">Inches:</span>
<input id="inches-input" type="number" class="form-control" step="0.01" min="0" required>
</div>

<div class="input-group">
<span class="input-group-text">Result:</span>
<p id="result" class="form-control result"></p>
</div>
</div>
</body>
</html>