[TYPO3-team-core-v5] Validation: should '123' be considered a valid float?
Malte Jansen
mail at maltejansen.de
Fri Sep 26 21:54:48 CEST 2008
Hi Karsten,
a while ago in of my lecture the float was defined as something like that:
<float> := <integer>,<integerWithLeadingZero> | <integer>
But I cannot remember, where it was exactly.
Perhaps there should be something like:
public static is_float($value, $numberOfDecimalPlacement = NULL) {
When $numberOfDecimalPlacement == NULL than floats and integers are allowed.
When $numberOfDecimalPlacement == TRUE than any float with a dot is allowed.
When $numberOfDecimalPlacement == <integer> than a float with the
certain number is allowed...
}
Cheers,
Malte
Karsten Dambekalns schrieb:
> But there's a philosophical^W^Wanother point to the story: Imagine a
> "Weight Watchers" website. You need to enter your weight. The argument
> has been assigned a "float" validator.
>
> You enter | Valid?
> 87.5 | Yes
> 68.0 | Yes
> 100 | No
> So, should we
> a) accept 100 as valid float or rather
> b) declare both int and float as acceptable in the example above?
>
>
> Regards,
> Karsten
More information about the TYPO3-team-core-v5
mailing list