title: Number rounding and precision problems in XSLT 1.0
body: <p>I have an inconsistency while using xsl,</p>
  
  <p>here is the xml,</p>
  
  <pre><code>&lt;Rate&gt;
      &lt;TotalRate&gt;506.41&lt;/TotalRate&gt;
      &lt;TotalTax&gt;17&lt;/TotalTax&gt;
      &lt;Currency&gt;INR&lt;/Currency&gt;
  &lt;/Rate&gt;
  </code></pre>
  
  <p>and xsl,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;
      &lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/&gt;
      &lt;xsl:template match="/"&gt;
          &lt;TotalAmount&gt;
              &lt;xsl:value-of select="Rate/TotalRate + Rate/TotalTax"/&gt;
          &lt;/TotalAmount&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>and the output is,</p>
  
  <pre><code>&lt;TotalAmount xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;523.4100000000001&lt;/TotalAmount&gt;
  </code></pre>
  
  <p>but the expected o/p is,</p>
  
  <pre><code>&lt;TotalAmount xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt;523.41&lt;/TotalAmount&gt;
  </code></pre>
  
  <p>Why the o/p is 523.4100000000001? how can i get 523.41 without rounding it?</p>