Convert To Double - CSharp System

CSharp examples for System:Converter

Description

Convert To Double

Demo Code


using System.Data.SqlClient;
using System.Data;
using System.Collections.Generic;
using System;/*from w  w w  . j  a v a 2 s.c  om*/

public class Main{
        internal static double ConvertToDouble(object value)
        {
            double decValue = 0;
            if (!Convert.IsDBNull(value))
            {
                double.TryParse(value.ToString(), out decValue);
            }
            return decValue;
        }
}

Related Tutorials