Rounds a number arithmetically.

Namespace

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

Syntax

 double NormalRound(decimal num, int places)

Parameters

Name

Description

number

Number to round

placeNumber of decimal places to round.

Example

This example rounds a number on 2 decimal places.

<ROOT>
    <test number="3.1415927"/>
</ROOT>
<?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:NormalRound(/ROOT/test/@number, 2)"/>
    </xsl:template>
</xsl:stylesheet>