Share via


floor Function

Returns the largest integer that is not greater than the argument.

number floor(number)

Example

This example demonstrates floor() expressions.

XML File

None; the XSLT file calls itself.

XSLT File (floor.xsl)

<?xml version='1.0'?>
<?xml-stylesheet type="text/xsl" href="floor.xsl"?>
<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
   <p/>floor(3.5) = 
      <xsl:value-of select='floor(3.5)'/>
   <p/>floor(-1.3) = 
      <xsl:value-of select='floor(-1.3)'/>
   <p/>floor(4) = 
      <xsl:value-of select='floor(4)'/>
</xsl:template>

</xsl:stylesheet>

Formatted Output

floor(3.5) = 3

floor(-1.3) = -2

floor(4) = 4

Processor Output

<?xml version="1.0"?><p />floor(3.5) =
      3<p />floor(-1.3) =
      -2<p />floor(4) =
      4

See Also

Reference

XML Data Types Reference