Skip to main content
Jul 03, 2013
/// <summary>
/// Method checks if passed string is double
/// </summary>
/// <param name="text">string text for checking</param>
/// <returns>bool - if text is double return true, else return false</returns>
public bool IsDouble(string text)
{
  Double num = 0;
  bool isDouble = false;
 
  // Check for empty string.
  if (string.IsNullOrEmpty(text))
  {
    return false;
  }
 
  isDouble = Double.TryParse(text, out num);
 
  return isDouble;
}