Non-numeric characters in number field producing errors Craft 3 is giving me this error when my client enters non-numeric characters into a number field on an entry:


  number_format() expects parameter 1 to be float, string given


Is there a way for it to check and remove non-numeric characters from the field on save? Or maybe my setup is incorrect?
Just tested this on a local Craft3 setup and here's what I discovered...

If the decimal points setting on the number field is set to 0, adding text in the number field will display the pretty errors below:



If the decimal points setting is set to anything else, you get the Twig error mentioned in the title of this post:


  number_format() expects parameter 1 to be float, string given


I'd recommend opening an issue in the Craft CMS repo as I imagine the number field ought to display the pretty errors no matter if decimal points is set or not.