Steve it works alright for me looking like this;

<%

PHONE = 4037815200
Function FormatPhone(PHONE)

        IF PHONE <> "" THEN
                Response.write "Phone = " & Phone & "<BR>"
                Response.write "Right = " & Right(Phone,4) & "<BR>"
                FormatPhone = "(" & LEFT(PHONE,3) & ") " & MID(Phone,4,3) &
"-" & Right(Phone,4)
                Response.write FormatPhone
                Response.end
        ELSE
                FormatPhone = ""
        END IF
END FUNCTION

call formatPhone(PHONE)

%>

Hope it helps
-----Original Message-----
From: Steve Abaffy [mailto:sabaffy@;cditelecom.com] 
Sent: Monday, November 11, 2002 1:13 PM
To: ActiveServerPages
Subject: Something Stupid I'm overlooking here.

Hello
I have the following function

Function FormatPhone(PHONE)

        IF PHONE <> "" THEN
                Response.write "Phone = " & Phone & "<BR>"
                Response.write "Right = " & Right(Phone,4) & "<BR>"
                FormatPhone = "(" & LEFT(PHONE,3) & ") " & MID(Phone,4,3) &
"-" &
Right(Phone,4)
                Response.write FormatPhone
                Response.end
        ELSE
                FormatPhone = ""
        END IF
END FUNCTION

which has the following outoput

Phone = 4037815200
Right = 0
(403) 781-0

As you can see it should be (403) 781-5200 so what obvious thing am I over
looking here???




---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to