JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="number" value="1000"/>
JavaScript
$('#number').keypress(function (event) {
if (event.which <= 46 || event.which > 59) {
event.preventDefault();
}
});
$('#number').bind('blur', function (e) {
if ($(this).val().length > 0) $(this).val(parseFloat($(this).val()).toFixed(2));
});