JSFiddle - React, Tailwind, and code Playground
by joycse06
HTML
<input type="text" />
CSS
input{
margin:20px;
width: 200px;
height: 20px;
padding: 5px;
}
JavaScript
$('input').on('blur',function(){
$(this).val(function(index,val){
return parseFloat(val).toFixed(2);
});
});