public static bool IsExpectedNumber(string strValue, int intAllowedPrecision)
{
if (string.IsNullOrEmpty(strValue))
{
return false;
}
else if (intAllowedPrecision == 0)
{
return Regex.IsMatch(strValue, "^d{0,3}");
}
else
{
return Regex.IsMatch(strValue, "^\\d{0,3}(\\.\\d{1," + intAllowedPrecision.ToString() + "})?$");
}
}