Coding For a Living

rss

A place to share and comment about coding for a living.


String IsDecimal Method Extension Mike McIntyre

 

public static class ExtNumbers
{
    public static decimal ToDecimal(this string value)
    {
        decimal result = Con.D0000m;
        if (String.IsNullOrEmpty(value))
        {
            return result;
        }
        decimal.TryParse(value, out result);
        return result;
    }
}