Brian Dunning's FileMaker Custom Functions

Phone#Format ( Phone )

Formats a 7 or 10 digit phone number

  Average rating: 3.8 (44 votes) Log in to vote

Steve Bush   Steve Bush
Intellisoft Development
http://www.intellisoftdevelopment.com

Share on Facebook Share on Twitter

  Sample input:
Phone#Format ( 7025551234 )
  Sample output:
702 555-1234

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Formats a 7 digit or 10 digit phone number. First removes a leading '1' and all alpha characters. If the result is neither 7 nor 10 digits, the phone number is displayed in red text. This function uses a space between the area code and the number, so it takes up the minimal amount of room.

 

Comments

Olia   Olia, Montreal
Feb 7, 2014
Thanks for this custom functions. I am new to filemaker and it helped me a lot. I have one question. How should I modify the calculation to accommodate phone numbers with area codes starting with the number 1. (ex. 108 222-2222).

Thanks a lot for the help.
O
 
Thomas   Thomas, Pittsbugh
Feb 16, 2014
I believe that this phone format function is primarily for US and Canada, neither of which us 1 to start an area code. However if you comment out the 2 "num" line that should do it.

// num = Case(Left(num;1)= "1"; Middle(num;2;20); num);
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:

Under construction. Email me your wish list for improvements.