var RegularExpression = new RegExp(^\d+(\.\d{1,2})?$); if (RegularExpression.match("your_number_string")) { alert("Valid Number"); } else { alert("INVALID Number"); }
public static bool IsDesimal(string strValue) { string decimalNumber = ".0123456789"; for (int i = 0; i < strValue.Trim().Length; i++) { if (decimalNumber.IndexOf(strValue[i]) == -1) { return false; } } return true; } /// <summary> /// Returns the Validate Input Numeric Value /// </summary> /// <param name="strValue"></param> /// <returns>Numeric Value</returns> public static bool IsNumeric(string strValue) { string decimalNumber = "0123456789"; for (int i = 0; i < strValue.Trim().Length; i++) { if (decimalNumber.IndexOf(strValue[i]) == -1) { return false; } } return true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)