JSFiddle - React, Tailwind, and code Playground

by Alexey Demin

HTML

<form>
  <input type="text" pattern="[0-9]+([\.,][0-9][0-9]?)?" title="This should be a number with up to 2 decimal places." />
  <input type="submit" />
</form>