title: Can I change XSLT 1.0 to round negative half numbers down instead of up? i.e. -2.5 to -3
body: <p>XSLT 1.0 seems to round negative half numbers up instead of down (i.e. -2.5 to -2). Although it may seem less conventional, can I change it to round that to -3? </p>
  
  <p>Is there a way to change this behavior (develop a new function, use a different function, supply parameters, etc), or do I have to use a template?</p>
  
  <p>I wrote my own template already, but it makes my XSL much more messy than when it just included round functions.</p>
  
  <p>
      </p>
  
  <pre><code>&lt;xsl:template match="/"&gt;
    &lt;xsl:value-of select="round(-2.5)"/&gt;
  
    &lt;xsl:call-template name="customRounding"&gt;
      &lt;xsl:with-param name="input" select="-2.5"/&gt;
    &lt;/xsl:call-template&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template name="customRounding"&gt;
    &lt;xsl:param name="input"/&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test="$input = ''"&gt;
        &lt;xsl:value-of select="0"/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:when test="$input &amp;lt; 0"&gt;
        &lt;xsl:value-of select="round($input * -1) * -1"/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:value-of select="round($input)"/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p></p>
  
  <p>EDIT: I had previously said that rounding negative numbers up could be considered more correct than rounding them down. However, after more reading, I realize that rounding half numbers is ambiguous, and conventions vary.</p>