You can use Regex to detect input discrepancy, adapt from this example:
using System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
{
string input = "12.3";
Regex regex = new Regex(
"^\\d{0,2}[.]\\d$",
RegexOptions.IgnoreCase
| RegexOptions.CultureInvariant
| RegexOptions.Compiled
);
if (regex.IsMatch(input))
{
Console.WriteLine("Valid");
}
else
{
Console.WriteLine("Not valid!");
}
}
}