title: NHibernate 3.0 rounding a decimal to 5 decimal places - why?
body: <p>All,</p>
  
  <p>We were using NHiberate 2.1 where we are storing decimal values (exchange rates) e.g. 123.1234567 to 7 decimal places</p>
  
  <p>We are mapping the type using default mapping style:</p>
  
  <pre><code>&lt;property name="ExchangeRate"  not-null="true" /&gt;
  </code></pre>
  
  <p>However when we upgrade to NHibernate 3.0 the value above is saved as 123.1234500.</p>
  
  <p>It does not specify this change in behaviour in the 3.0 release notes although it does seem to detail that in issue [NH-1594], the default value for decimal is DECIMAL(19,5)</p>
  
  <p>We have a solution i.e. specify the following mapping:</p>
  
  <pre><code>&lt;property name="ExchangeRate"  type="decimal(10,7) not-null="true" /&gt;
  </code></pre>
  
  <p>I need to know is this solution the right way to solve this issue?
  Also, why is there a functional change in behaviour with rounding between 2.1 and 3.0?</p>
  
  <p>Cheers,</p>
  
  <p>Billy Stack</p>