How can I edit this code to where it shows only two slots to the right of decimal? (trying to make it look like currency). Trying to set up a simple roommate calculator Below is the code that I have so far:
<!DOCTYPE html>
<html>
<head>
<title>Bill Calculator</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="centerDiv">
<form name="formcalc">
Bill Amount: <input type="text" name="bill1"><br>
<div><h2>Jake pays:
<div id="jake"></div></h2></div>
<div><h2>Miguel pays:
<div id="miguel"></div></h2></div>
<input type="button" value="calculate" onClick="sumValues()">
</form>
</div>
<script type="text/javascript">
function sumValues()
{
var num1, jake, miguel;
num1=Number(document.formcalc.bill1.value);
jake=num1*0.6;
miguel=num1*0.4;
document.getElementById('jake').innerHTML = '$' + jake;
document.getElementById('miguel').innerHTML = '$' + miguel;
}
</script>
</body>
</html>