JSFiddle - React, Tailwind, and code Playground

JavaScript

if("3.5".match(/[^\d\.]/))
    alert("non digits present");