title: Accepting only decimals and numbers in Console.ReadLine
body: <p>I have just made a program to calculate the total cost of an item or items given the quantity and price. One of my concerns is in the Cost of Item field, it does not accept decimals at all. I would also like both fields to not accept letters. I have seen something about <code>TryParse</code> but I am unsure of how to use this and how it works. Any help is appreciated.
  Here is my code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace QuantityPrice
  {
      class Program
      {
          static void Main(string[] args)
          {
              int Quantity;
              int Cost;
              Console.WriteLine("How much is the item you are buying? (In Canadian Dollars)");
              Cost = int.Parse(Console.ReadLine());
              Console.WriteLine("How many of the item are you buying? (In Canadian Dollars)");
              Quantity = int.Parse(Console.ReadLine());
              var TotalCost = Quantity * Cost * 1.13;
              Console.WriteLine("Your total cost is:");
              Console.WriteLine("$" + TotalCost);
              Console.ReadLine();
              System.Threading.Thread.Sleep(100000);
          }
      }
  }
  </code></pre>