XSLT Function AsapRound

Rounds a number by a user configured profile.

NAMESPACE

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

SYNTAX

string AsapRound(decimal number, string asapRoundingId)

PARAMETERS

Name Description
number Number to be rounded.
asapRoundingId Rounding profile Id.

EXAMPLE

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

<ROOT> 
    <test number="3.1415927" roundingId="dcf49d56-62a7-4d29-adc9-c664fb65cf06"> 
</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)"/> 
    </xsl:template> 
</xsl:stylesheet>