XSLT Function Round

Rounds a number specified by user

NAMESPACE

xmlns:AS="http://schema.advantages.cz/AsapFunctions"

SYNTAX

string Round(decimal number, string origamRoundingId, string roundingPosition)

PARAMETERS

Name Description
number Number to be rounded.
origamRoundingId Rounding profile Id.
roundingPosition Position of rounding

EXAMPLE

This example rounds a number using a provided profile.
Source XML

<ROOT> 
    <test number="3.1415927" roundingId="AS:GetConstant('OrigamRoundingType_Arithmetic')" positions="0.001"> 
</ROOT>

Stylesheet

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 
    xmlns:AS="http://schema.advantages.cz/AsapFunctions" 
    xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="AS date"> 
    <xsl:template match="/"> 
        <test test="AS:AsapRound(/ROOT/test/@number, /ROOT/test/@roundingId), /ROOT/test/@positions"/> 
    </xsl:template> 
</xsl:stylesheet>