title: How to check if a string is a decimal/ float number?
body: <p>I need to check if a string is of the form of a decimal/ float number. </p>
  
  <p>I have tried using isdigit() and isdecimal() and isnumeric(), but they don't work for float numbers. I also can not use try: and convert to a float, because that will convert things like " 12.32" into floats, even though there is a leading white-space. If there is leading white-spaces, I need to be able to detect it and that means it is not a decimal.</p>
  
  <p>I expect that "5.1211" returns true as a decimal, as well as "51231". However, something like "123.12312.2" should not return true, as well any input with white-space in it like " 123.12" or "123. 12 ". </p>