public static string ConvertToString(object objValue) { string result = ""; if (!CommonAPI.IsNullValue(objValue)) { result = objValue.ToString(); } return(result); }
public static int ConvertToInt(object objValue) { int result = 0; if (!CommonAPI.IsNullValue(objValue)) { int.TryParse(objValue.ToString(), out result); } return(result); }
/// <summary> /// Converts to double. /// </summary> /// <param name="objValue">The object value.</param> /// <returns>System.Double.</returns> public static double ConvertToDouble(object objValue) { double result = -1.0; if (!CommonAPI.IsNullValue(objValue)) { double.TryParse(objValue.ToString(), out result); } return(result); }