The following script formats a US phone number in Filemaker Pro. Define Database>Highlight Field name>Options>Specify calculated value (uncheck "do not replace existing value" box).
Let(
p = Filter ( FieldVariable ; "0123456789" )
;
Case(
Length ( p ) < 10; p & TextColor ( " Not enough digits" ; RGB ( 255 ; 0 ; 0 ) );
"(" & Left( p; 3) & ") " & Middle( p; 4; 3) & "-" & Middle( p; 7; 4) & Case( Length ( p ) > 10; " x" & Middle( p; 11; 999))
)
)
« All Done!
Posted by LaDonna at 07:23 AM on 06/06/06 • Permalink •
Comments [0]
• Filed under:
Personal •