Closed (fixed)
Project:
Form API Validation
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2014 at 10:06 UTC
Updated:
8 Feb 2025 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ss81 commentedComment #2
spadxiii commentedThis rule also doesn't accept a single digit. Which is still a valid number.
Does a decimal require a decimal separator and decimals or can integers be valid as well?
Side note: in different areas in the world, a comma is used as decimal separator. The validation also doesn't account for that.
Side note 2: perhaps use the php function filter_var (with FILTER_VALIDATE_FLOAT) instead of a regex?
Comment #3
spadxiii commentedJust had a thought that "1.2.3" is not a valid decimal. Updating this issue to make it more general for the decimal-rule.
Comment #4
pedrofaria commentedYour suggestion was ported to version 8. thanks
Comment #6
astonvictor commentedSince, it's committed then we can close it.
Comment #7
astonvictor commented