Use Google to find help fast. For example, search on "xpressdox choosefromlist".

The ceiling and floor functions

The ceiling and floor functions

These are two XSLT functions and so have been available since the inception of XpressDox, but have recently been added to the Command Editor.  In essence, they perform the equivalent of a “round up” (ceiling) and “round down” (floor) to the nearest integer.

For example, if the value 25 has been captured into data element Amount, then

«ceiling(RegionToX(Amount) div 3)»

will output the value 9


«floor(RegionToX(Amount) div 3)»

will output 8.

Note the use of the RegionToX function – this is because the ceiling and floor functions are XSLT functions and thus need an XSLT-compliant number format passed to them. So if you are in a region where your regional settings indicate a decimal character other than ‘.’ (period or full-stop), and you know that Amount will conform to those regional settings, then the RegionToX function needs to be employed. More on this at: Handling calculations and Regional Settings in XpressDox.

Leave a Reply