I am using Filemaker 10.0v3 on a MacBook Pro OS 10.6.3.
I want to be able to enter a series of numbers and force a specific format to them.
Example: Enter 123456789, Show 12.345.678-9.
How do I do this?
Formatting a number field the way you show, means it must be a text field.
Is the number of digits constant?
One way would be to use a number field, verified to contain the required number of digits.
The formatted (text) field would be calculated with left, middle, and right with the symbols inserted.
Yes. The number of characters is constant. There is no real reason that it has to be a number field though, since there is never any need to calculate anything.
This expression would serve:
Let ( n = Filter (yourfield ; "0123456789") ; Left ( n ; 2 ) & "." & Middle ( n ; 3 ; 3 ) & "." & Middle ( n ; 6 ; 3 ) & "-" & Right ( n ; 1 ) )
You could even set this up as an auto-entered calculation with "self" in place of "yourfield" on your original data field, just be sure to clear the "do not replace existing value..." check box if you do.
Retrieving data ...