Visit Mozilla.org

XPath:Fonctions:format-number

Un article de MDC.

Référence XSLT/XPath : Éléments XSLT, Fonctions EXSLT, Fonctions XPath, Axes XPath

Sommaire


La fonction format-number évalue un nombre et retourne une chaîne représentant le nombre dans un format donné.

[modifier] Syntaxe

format-number( nombre , motif [, format-décimal] )

[modifier] Arguments

nombre
Le nombre à formater.
motif
Une chaîne au format de la classe Decimal Format (en) du JDK 1.1.
format-décimal (optionnel)
Le nom d'un élément xsl:decimal-format qui définit le format de nombre à utiliser. Si il est omis, le format décimal par défaut est utilisé.

[modifier] Retour

Une chaîne représentant le nombre dans le nouveau format.

[modifier] Notes

Cette fonction est un ajout à XPath spécifique à XSLT. Elle ne fait pas partie de la bibliothèque de fonctions XPath principale.

[modifier] Définition

XSLT 1.0, section 12.3.

[modifier] Support Gecko

Supportée.