title: Entity Framework Database First Decimal Precision
body: <p>I am new to MVC, I use database first (sql server 2008) approach using EF6. What my problem is I am trying to save a decimal value with 3 decimal places, saving is okay but when I view it in my SQL Server 2008 database it saved 2 precise decimal places then followed by zeros. <br />
  For example I am trying to save 0.025, I can see it passed 0.025 in my save method but when I view what is saved in my db it is 0.0200, database data type is decimal(18,4). What am I doing wrong? Please help!</p>
  
  <p>UPDATE: <br />
  I may have found similar question asked and answered that I have to set the decimal precision in model creating but how can I do this as it seem to be fitted only to code-first approach: <br />
  <a href="https://stackoverflow.com/questions/9032919/set-decimal16-3-for-a-column-in-code-first-approach-in-ef4-3">Set decimal(16, 3) for a column in Code First Approach in EF4.3</a></p>
  
  <pre><code>modelBuilder.Properties&lt;decimal&gt;().Configure(c =&gt; c.HasPrecision(18, 3));
  </code></pre>