title: TryParse failing with negative numbers
body: <p>I'm having a problem getting TryParse to work correctly for me.  I have a list of values that I am almost assured are valid (as they come from another component in our system) but I would like to make sure there is proper error handling in place.</p>
  
  <p>Here is an example list of my values:</p>
  
  <p>20.00<br>
  20.00<br>
  -150.00</p>
  
  <p>And here is the method I originally wrote:</p>
  
  <pre><code> private decimal CalculateValue(IEnumerable&lt;XElement&gt; summaryValues)
          {
              decimal totalValue = 0;
  
              foreach (XElement xElement in summaryValues)
              {
                  decimal successful;
                  Decimal.TryParse(xElement.Value, out successful);
                  if (successful &gt; 0)
                      totalValue += Decimal.Parse(xElement.Value);
              }
              return totalValue;
          }
  </code></pre>
  
  <p>The variable 'successful' was returning false for -150.00, so I added NumberStyles:</p>
  
  <pre><code>private decimal CalculateValue(IEnumerable&lt;XElement&gt; summaryValues)
          {
              decimal totalValue = 0;
  
              foreach (XElement xElement in summaryValues)
              {
                  decimal successful;
                  Decimal.TryParse(xElement.Value, NumberStyles.AllowLeadingSign, null, out successful);
                  if (successful &gt; 0)
                      totalValue += Decimal.Parse(xElement.Value, NumberStyles.AllowLeadingSign);
              }
              return totalValue;
          }
  </code></pre>
  
  <p>However, now that I have the NumberStyles in there, none of the numbers will parse!  I feel good about having IFormatProvider set to null as this is all within our system.  Does anyone see what I may be doing wrong?</p>