clos123456789
Gebruiker
- Lid geworden
- 6 mei 2013
- Berichten
- 53
Wie kan mij helpen met 2 cijfers achter de komma?
Chr.los
Chr.los
Code:
<script language = "JavaScript">
<!--
function round(number,decimals)
{
return Math.round(number*Math.pow(10,decimals))/Math.pow(10,decimals);
}
function Heatwaarde(amp, volt, speed, factor)
{
var heat = amp * volt * 60 * factor / speed / 10000;
return heat;
var afgeronde_heat = round(heatwaarde,2);
return afgeronde_heat;
}
function Rekenen(ampwaarde, voltgetal, factorgetal, speedsnelheid)
{
heatwaarde = Heatwaarde(ampwaarde, voltgetal, factorgetal, speedsnelheid);
document.heat.resultaat.value = heatwaarde;
}
//-->
</script>
</head>
<form name = "heat">
<center>
<table>
<tr><td width = "100px" bgcolor="#9ACD32"><b>Amperage. </b></td><td width = "100px" bgcolor="#9ACD32"><input type = "text" name="amp" size = "4" maxlength = "4"></td></tr>
<tr><td width = "100px" bgcolor="#9ACD32"><b>Voltage. </b></td><td width = "100px" bgcolor="#9ACD32"><input type = "text" name="volt" size = "4" maxlength = "2"></td></tr>
<tr><td width = "100px" bgcolor="#9ACD32"><b>Speed cm/min. </b></td><td width = "100px" bgcolor="#9ACD32"><input type = "text" name="speed" size = "4" maxlength = "3"></td></tr>
<tr><td width = "100px" bgcolor="#9ACD32"><b>Factor. </b>
</td><td width = "100px" bgcolor="#9ACD32"><input type = "text" name="factor" size = "4" maxlength = "3"></td></tr>
<tr><td width = "100px" bgcolor="#9ACD32"><b>Kj/mm. </b></td><td width = "100px" bgcolor="#9ACD32"><input type = "text" name="resultaat" size = "4" maxlength = "3"></td></tr>
</table>
</center>
Laatst bewerkt door een moderator: