DefaultDoubleValue on TextBox in C#.net
public static Double DefaultDoubleValue(TextBox txt)
{
try
{
if (String.IsNullOrEmpty(txt.Text))
{
return 0.00;
}
else
{
return Convert.ToDouble(txt.Text);
}
}
catch (Exception ex)
{
Program.WriteLog(ex.Message, ex.StackTrace);
return 0.00;
}
}
{
try
{
if (String.IsNullOrEmpty(txt.Text))
{
return 0.00;
}
else
{
return Convert.ToDouble(txt.Text);
}
}
catch (Exception ex)
{
Program.WriteLog(ex.Message, ex.StackTrace);
return 0.00;
}
}