Hi,
I'm trying to do a generic tryparse for any data type, well stuff like int, double, decimal etc.
So if a value is null will just return defaulv value of 0.
here is an example of what i'd like to convert from:
protected decimal DecimalTryParse(object value)
{
decimal valueConverted = 0;
if (value != null)
{
decimal.TryParse(value.ToString(), out valueConverted);
}
return valueConverted;
}
Thanks inadvance
I'm trying to do a generic tryparse for any data type, well stuff like int, double, decimal etc.
So if a value is null will just return defaulv value of 0.
here is an example of what i'd like to convert from:
protected decimal DecimalTryParse(object value)
{
decimal valueConverted = 0;
if (value != null)
{
decimal.TryParse(value.ToString(), out valueConverted);
}
return valueConverted;
}
Thanks inadvance