<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="extensions" page="functions" subpage="decimaldivide"/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: saxon:decimal-divide()</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: saxon:decimal-divide()"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>saxon:decimal-divide()</h1>
      <p><b>saxon:decimal-divide($arg1 as xs:decimal, $arg2 as decimal, $precision as integer) ==&gt; xs:decimal</b></p>
      <p>This performs a decimal division to a user-specified precision. The value of the first argument
is divided by the second argument, and the result is returned to the number of decimal places
indicated by the third argument. The exact result is rounded towards zero. For example,
<code>decimal-divide(100, 30, 2)</code> returns 0.33. (The default for decimal division in Saxon
using the <code>div</code> operator is to return <i>max(18, s1, s2)</i> decimal places in the result,
where <i>s1</i> is the scale of the first operand and <i>s2</i> the scale of the second.)</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="deepequal.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>