JSFiddle - React, Tailwind, and code Playground
by Derek Leung
HTML
<input id="first" value="0.5"> + <input id="second" value="0.7"> = <input id="result"><br>
The problem:<br>
Try 0.1 + 0.2, it does not equal to 0.3<br>
0.01 + 0.06 does not equal to 0.07
CSS
input{
width:50px;
}
JavaScript
function add(){
$("#result").val(
(+$("#first").val()) + (+$("#second").val())
);
}
add();
$("input").blur(add);