ThisToThat/ThisToThat/ToDoubleExtensions.cs
/// <summary>
/// Converts and returns this string's value as Double.
/// The default value passed in is returned if the string does not successfully parse to Double.
/// </summary>
/// <returns>This string converted to Double, or the default value if conversion unsuccessful.</returns>
Converts and returns this string's value as Double.
The default value passed in is returned if the string does not successfully parse to Double.
Converts and returns this string ' s value as Double . The default value passed in is returned if the string does not successfully parse to Double .
public static Double ToDoubleOrDefault(this string strThisString, Double doubleDefault = default(Double))
        {
            Double doubleReturn;
            return Double.TryParse(strThisString, out doubleReturn) ? doubleReturn : doubleDefault;
        }
public static Double ToDoubleOrDefault ( this string strThisString , Double doubleDefault = default ( Double ) ) { Double doubleReturn ; return Double . TryParse ( strThisString , out doubleReturn ) ? doubleReturn : doubleDefault ; }
Converts and returns this string's value as Double.
Converts and returns this string ' s value as Double .
This string converted to Double, or the default value if conversion unsuccessful.
This string converted to Double or the default value if conversion unsuccessful .
string
this
doubleDefault
Double