I want a simple calculation form. I took te example of w3schools:
and this is myd adjusted code:
<!DOCTYPE html>
<html>
<body>
<form oninput="x.value=parseFloat(a.value).round(2)* parseFloat(b.value).round(2)">
<input type="number" id="a" value="50">
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>
</form>
<p><strong>Note:</strong> The output tag is not supported in Internet Explorer.</p>
</body>
</html>
when I add the round(2) (form oninput)then it won't work. if I remove it, it wil work. But if I add some numbers after the decimal, the I get a whole bunch of numbers with lots of zerro's.
I just want a 2 digit output.
can anyone help me please?
I also checkout this link:
parse float with two decimal places
but I can't get it to work