![]() |
Phone Number function |
Post Reply ![]() |
Author | |
joshs ![]() Newbie ![]() Joined: 07-April-2009 Location: Utah Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() Posted: 02-July-2011 at 5:40pm |
Is there a sub function / function already built in the system to standardize or format phone numbers?
ie. 8669299626 to (866) 929-9626 Josh
|
|
Josh Shirley
josh@windsurfutah.com |
|
![]() |
|
joshs ![]() Newbie ![]() Joined: 07-April-2009 Location: Utah Status: Offline Points: 14 |
![]() ![]() ![]() ![]() ![]() |
well, I guess it is not worth the time to search for:
Here is my edit to the stringfunctions.asp file: /////////////////////////////////////////////////////////////////////////////////////////// '***************************************************************************************************** '// Format display phone numbers '***************************************************************************************************** Function phoneformat(byVal phonenumber) phonenumber = Cstr(phonenumber) phonenumber = Trim(phonenumber) phonenumber = Replace( phonenumber, " ", "") phonenumber = Replace( phonenumber, "-", "") phonenumber = Replace( phonenumber, "(", "") phonenumber = Replace( phonenumber, ")", "") phonenumber = Replace( phonenumber, ".", "") phonenumber = Replace( phonenumber, ",", "") select case LEN(phonenumber) Case 10 tmp = tmp & "(" & mid(phonenumber,1,3) & ") " tmp = tmp & mid(phonenumber,4,3) & "-" tmp = tmp & mid(phonenumber,7,4) case 11 tmp = tmp & mid(phonenumber,1,1) & " " tmp = tmp & "(" & mid(phonenumber,2,3) & ") " tmp = tmp & mid(phonenumber,5,3) & "-" tmp = tmp & mid(phonenumber,8,4) case else phoneformat = null exit function end select phoneformat = tmp end function //////////////////////////////////////////////////////////////////////// So any place a phone number is listed this can be added: phoneformat(scCompanyPhoneNumber) 'uses phone number listed by store settings. or phoneformat("8669299626") wah la |
|
Josh Shirley
josh@windsurfutah.com |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |