Edit in JSFiddle

<div>
0.1 + 0.2 = <input id="sum"/>
</div>
div {
  width: 300px;
}

$("#sum").val(0.1 + 0.2);