title: WPF formatting labels with StringFormat
body: <p>I have a WPF application. I have some labels and some datagrids which are bound to some public properties. Some of these properties are numerical values.</p>
  
  <p>In the datagrids I have been using the line below to ensure the values only display two decimal places, which works. However when I use the same line below for my label it appears to have no effect on the display as the number shows to about 9 decimal places. I don't understand why it works for the datagrid but not the label?</p>
  
  <pre><code>StringFormat={}{0:0.##}
  
  
  
  &lt;Label Grid.Row="3" Grid.Column="1"
         Content="{Binding Obs.Tstat, StringFormat={}{0:0.#}}" 
         HorizontalAlignment="Center" Foreground="{StaticResource brushLinFont}" 
         FontSize="13" FontWeight="Bold"/&gt;
  </code></pre>
  
  <p><strong>Updated code</strong></p>
  
  <pre><code> &lt;Label Grid.Row="3" Grid.Column="1"
          Content="{Binding Obs.Tstat}" ContentStringFormat="{}{0:0.#}}" 
          HorizontalAlignment="Center" Foreground="{StaticResource brushLinFont}" 
          FontSize="13" FontWeight="Bold"/&gt;
  </code></pre>