title: TryParse not working when trying to parse a decimal number to an Int
body: <p>I am trying to parse strings that may have a decimal. I'm using <code>Int32.TryParse</code> but it doesn't seem to be working.</p>
  
  <p>Here is my function where I try to parse:</p>
  
  <pre><code>private NumberStyles styles = NumberStyles.Number;
  private CultureInfo culture = CultureInfo.CurrentCulture;
  public int? ParseInt(string node)
  {
      int number;
      if (Int32.TryParse(node, styles, culture.NumberFormat, out number))
      {
          return number;
      }
      return null;
   }
  </code></pre>
  
  <p>And here is my unit test that is failing</p>
  
  <pre><code>[Fact]
  public void TestParseIntWithDecimal()
  {
      string provided = "28.789";
      int expected = 28;
  
      int? actual = _parser.ParseInt(provided);
  
      Assert.NotNull(actual);
      Assert.Equal(expected, actual);
  }
  </code></pre>
  
  <p>When I run my unit test, <code>null</code> is returned from <code>ParseInt</code> and I don't understand why. I thought <code>TryParse</code> could parse decimal numbers into integer numbers.</p>