Jump to content

This topic is 5825 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi All,

I have the standard calculation in my database for a phone number:

Let (

//define variables:

[

rawNumber = Filter (Phone; "0123456789") ;

length = Length (rawNumber);

red = RGB (160;0;0);

//set error flag for a phone number that's too short

error = If ( length < 10 ; TextColor ("error: " & Phone; red); "")

];

// now apply the phone formatting and return resuilts

If ( error ≠ ""; error;

"(" & Left (rawNumber; 3) & ") " & Middle ( rawNumber; 4; 3) & "-" & Middle ( rawNumber; 7; 4) &

// this condition tests for extra digits that we'll treat as an extension

If ( length > 10; " x" & Middle (rawNumber; 11; length - 10); "")

)

)

How can I tweek this calculation to also format a 10 character alphanumberic phone number? I have many companies that have Toll free alphanumeric numbers ie 800-THE-BOMB. Any help would be appreciated!

Thanks,

Kim

Posted (edited)

Change this line:

rawNumber = Filter (Phone; "0123456789") ;

To:

rawNumber = Filter (Upper(Phone); "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") ;

Edited by Guest

This topic is 5825 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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