title: Currency symbol in numeric value based on object property in XAML
body: <p>How to show a numeric (currency) value in <code>WPF</code> so that the currency symbol would not come from the user's regional settings, locale or anything but from the property of the binded object.</p>
  
  <p>For example in <code>DataGrid</code> I would have <code>Item</code> objects:</p>
  
  <pre><code> &lt;DataGrid Grid.Row="1" ItemsSource="{Binding Items}"&gt;
        &lt;DataGrid.Columns&gt;
             &lt;DataGridTextColumn Binding="{Binding SomeNumber, StringFormat=c}" /&gt;
        &lt;/DataGrid.Columns&gt;
   &lt;/DataGrid&gt;
  
  public Item()
  {
      public double SomeNumber { get; set; }
      public string CurrencySymbol { get; set; }
  }
  </code></pre>
  
  <p>The above standard <code>"c"</code>formatting will show currency symbol based on some user setting and ignoring the business object.</p>
  
  <p>But the value should be displayed like this</p>
  
  <p>SomeNumber = 3456234.67 (positive numbers)</p>
  
  <pre><code>CurrencySymbol ="€" &gt; €3 456 234.67
  CurrencySymbol ="$" &gt; $3 456 234.67
  CurrencySymbol ="₽" &gt; ₽3 456 234.67
  </code></pre>
  
  <p>SomeNumber = -3456234.67 (negative numbers)</p>
  
  <pre><code>CurrencySymbol ="€" &gt; (€3 456 234.67)
  CurrencySymbol ="$" &gt; ($3 456 234.67)
  CurrencySymbol ="₽" &gt; (₽3 456 234.67)
  </code></pre>
  
  <p>SomeNumber= 0 (zero values)</p>
  
  <pre><code>CurrencySymbol ="€" &gt; -
  CurrencySymbol ="$" &gt; -
  CurrencySymbol ="₽" &gt; -
  </code></pre>
  
  <p>Is there a way to get the currency symbol to the value this way with <code>StringFormat</code>?</p>