Kimmie Posted February 17, 2009 Posted February 17, 2009 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
Genx Posted February 17, 2009 Posted February 17, 2009 (edited) Change this line: rawNumber = Filter (Phone; "0123456789") ; To: rawNumber = Filter (Upper(Phone); "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") ; Edited February 17, 2009 by Guest
Kimmie Posted February 20, 2009 Author Posted February 20, 2009 Hi GenX, I replaced the line, didn't get an error but it didn't format it to (###)AAA-AAAA.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now