JSFiddle - React, Tailwind, and code Playground

HTML

<form>
<input type="text" pattern="\d+(,\d{2})?">
    <input type="submit">
</form>