Anyone know why this does this?
Server Error in '/' Application.
Arithmetic operation resulted in an overflow.
# <asp:Label ID="Label4" runat="server" Font-Size="Medium" Text='<%# GetPhoneFormat(Eval("Phone")) %>' />
#
#
# Function GetPhoneFormat(ByVal Phone As String) As String
#
# Dim PhoneFormat As String
# If IsDBNull(Phone) Or IsNothing(Phone) Then
# PhoneFormat = " "
# Else
#
# Phone = CInt(Phone).ToString("(000) 000-0000")
# PhoneFormat = "<b>Phone:</b> " & Phone
#
# End If
#
#
# Return PhoneFormat
# End Function
#
Format Phone - Anyone? Arithmetic operation resulted in an overflow.
Started by vertigo262, Oct 19 2010 01:25 PM
2 replies to this topic
#1
Posted 19 October 2010 - 01:25 PM
|
|
|
#2
Posted 20 October 2010 - 05:53 PM
Someone gave me some better code. works
Dim cleanNumber As String = Regex.Replace(Phone, "[^0-9]", "")
Dim PhoneFormat As String = "<b>Phone:</b> " & Regex.Replace(cleanNumber, "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
Dim cleanNumber As String = Regex.Replace(Phone, "[^0-9]", "")
Dim PhoneFormat As String = "<b>Phone:</b> " & Regex.Replace(cleanNumber, "(\d{3})(\d{3})(\d{4})", "($1) $2-$3")
#3
Posted 20 October 2010 - 07:08 PM
Quote
Arithmetic operation resulted in an overflow.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









