title: asp.net C# decimal formatting money
body: <p>I have a decimal value stored db as "12.3456" I want it to show it to client as "12.34"</p>
  
  <p>I am using the code below .</p>
  
  <pre><code>&lt;%# DataBinder.Eval(Container.DataItem, "Price", "{0:c}")%&gt;
  </code></pre>
  
  <p>I want the format to be like this </p>
  
  <pre><code>12.3456 --&gt; 12.34
  </code></pre>
  
  <p>but it's giving me this instead.</p>
  
  <pre><code>12.3456 --&gt; 12.3500
  </code></pre>
  
  <p>I am not sure if I am missing something or did something wrong.</p>
  
  <hr>
  
  <p><em>UPDATE</em></p>
  
  <p>I end up doing with <code>asp:Label</code> instead of <code>&lt;%# DataBinder.Eval(Container.DataItem, "Price", "{0:c}")%&gt;</code></p>
  
  <pre><code>Label Price.Text = Math.Truncate(12.3456* 100) / 100).ToString();
  </code></pre>
  
  <p>which gives me:</p>
  
  <pre><code>12.34
  </code></pre>
  
  <p>but if the number is <code>12.1000</code> it's giving me:</p>
  
  <pre><code>12.1
  </code></pre>
  
  <p>I need it in the <code>12.10</code> format</p>