title: Best/quickest way to convert to float
body: <p>So I am trying to have input and output in float number.</p>
  
  <pre><code>Console.WriteLine("Enter float number: ");
  float number = Console.ReadLine();
  Console.WriteLine("{0}", number);
  </code></pre>
  
  <p>I see the problem that ReadLine will have format in string which will cause "Error CS0029: Cannot implicitly convert type 'string' to 'float' (CS0029)". Now, how do I convert string to float? I could use float.Parase:</p>
  
  <pre><code>string unformattedNumber;
  float number;
  
  Console.WriteLine("Enter float number: ");
  unformattedNumber = Console.ReadLine();
  
  number = float.Parse(unformattedNumber);
  
  Console.WriteLine("{0}", number);
  </code></pre>
  
  <p>But is there any better way to convert in same line as ReadLine statement is at?</p>