How wo control the length of a number field with preceding zero(es)? (FMP6, Win XP2)
am 04.11.2007 14:47:56 von Christoph Bouthillier
Dear Listeners:
I need to create a field for the Dutch "BSN" (citizen service number). It
consists of always 9 digits of which the first (and maybe even the second)
can be a zero (like my own).
If I create a number field, then the number 012345678 is not accepted when I
validate with "BSN either empty or 9 digits long".
I could of course make it a text field and then check for numbers only +
length, or even make 9 different mini-fields ;=(
Is there another way to check the length properly in a number field ? Since
I do not know the minimum and maximum numeric values of the BSN, I can't
check for that, and moreover, that would still not validate for the number
of bytes/digits if the minimum was e.g. 1 (to be presented as 000000001).
BTW, there is a bug in length validating in number fields. I tested the
calculated length:
Value => Calculated length
0 => length 1 (OK)
00 => length 1 (!)
001 => length 1 (!!)
0012 => length 2 (!!)
12 => length 2
TIA
--
Met vriendelijke groet / Mit freundlichen Gruessen / With kind regards
Christoph Bouthillier
p o s t <> oh-no-spam t e k s t o t a a l << d o t >> c o m
Forget the oh-no-spam
Re: How wo control the length of a number field with preceding zero(es)?(FMP6, Win XP2)
am 04.11.2007 16:38:42 von Matt Wills
on 11/04/07 8:47 AM Christoph Bouthillier said:
> Dear Listeners:
>
> I need to create a field for the Dutch "BSN" (citizen service number). It
> consists of always 9 digits of which the first (and maybe even the second)
> can be a zero (like my own).
>
> If I create a number field, then the number 012345678 is not accepted when I
> validate with "BSN either empty or 9 digits long".
>
> I could of course make it a text field and then check for numbers only +
> length...
So, my question is, why don't you do that?
What you're trying to force into being a number is text, same as a phone
"number," a US Social Security "number" or a Driver's License "number."
If you're not going to perform a mathematical operation on it, there is
no reason to define it as a number.
Matt
Re: How wo control the length of a number field with preceding zero(es)?(FMP6, Win XP2)
am 04.11.2007 19:50:05 von Howard Schlossberg
Christoph Bouthillier wrote:
> BTW, there is a bug in length validating in number fields. I tested the
> calculated length:
>
> Value => Calculated length
>
> 0 => length 1 (OK)
> 00 => length 1 (!)
> 001 => length 1 (!!)
> 0012 => length 2 (!!)
> 12 => length 2
Your results are all expected and desired behavior. The numeric value
of 00 is 0, whose length is 1 character. The numeric value of 0012 is
12, which is two characters.
You said:
> I could of course make it a text field and then check for numbers only +
> length
And that is exactly what I would do.