Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function MyChange() {
var myString = document.getElementById("MyInput");
var myNum = parseFloat(myString.value); // convert to dobule
var n = myNum.toFixed(2); // round to decimals
myString.value = n;
}
</script>
</head>
<body>
Type a number<input type="text" id="MyInput" value="5.125698"></p>
<button onclick="MyChange()">round to decimals</button>
</body>
</html>
The most helpful JAVASCRIPT solutions