Brian Dunning's FileMaker Custom Functions

CanadaPostalCodeFix ( "input" )

Standardized formatting of inputted Canadian postal code to A1A 1A1

  Be the first to rate this function Log in to vote

RealGrouchy   RealGrouchy - Show more from this author
https://realgrouchy.blogspot.com

  Sample input:
PostalCodeFix ( "a1a1a1" )
  Sample output:
A1A 1A1

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

This function takes user-provided input and attempts to convert it to Canadian postal code format A1A 1A1, ensuring all "A"s are uppercase letters, all "1"s are numbers, and there's a space between the two groups of 3.

e.g. PostalCodeFix ( "a1a1a1" ) results in "A1A 1A1"

If the entered input isn't consistent with a Canadian postal code, it will just return the input uppercase.

 

Comments

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 22 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: