Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Calculation to format Canadian Postal Code

Featured Replies

I need to format a postal code. I have about 400 of them in my database and this code includes both letters & numbers (example: K0J1L0 is what was imported. I need it to appear

K0J 1L0). It seems easy enough to add this space between the first 3 and last 3 letters/numbers. I used the following:

Let (

imput = Filter (Postal Code; "0123456789")

; Left (imput; 3) & " " & Right (imput; 3)

)

I formated the calculation to be text.

Yet it returned values that were only numbers! All of the letters became numbers!

Can you help?

The filter return the expect results I believe.

It Filtered out everything except the "0123456789" as it reads.

In the USA, this would probably what you wanted, but I'm not familiar with the Canada's Zips patterns, so maybe you can provide a few examples of what you have now, and what you want as the results.

Lee

Edited by Guest

  • Author

Hi Lee! Thanks! I figured out the problem last night after posting. I removed the filtering line and it works fine now. Thanks for all of your help!

You probably still need the filter to remove any non-alphanumeric characters that the user may enter, because the user may or may not enter a space between the 3rd and 4th character.

Also note, the letters D, F, I, O, Q and U are not used. So, you could set up your filter function like this:

Filter("0123456789ABCEGHJKLMNPRSTVWXYZ"

Let (

input = Filter (Postal Code; "0123456789ABCEGHJKLMNPRSTVWXYZ"); 

case(Length(input)<>6;"**INVALID**";Left (input; 3) & " " & Right (input; 3))

)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.