# xslt:format-number

xslt:format-number(numeric $value, string $picture) → string

Function signature

$value | xs:double ?
$picture | xs:string
Result | xs:string

Formats a number as specified by a picture string, using the default decimal format

XSLT 2.0 Specification

Implemented. Changed in 7.4.1 to use the new XSLT 2.0 specification. This creates slight incompatibilities from the previous version, which remains available under the name format-number-1.0(). There is one known restriction: characters such as the decimal-separator are restricted to be in the Unicode BMP, i.e. below Unicode 0xFFFF. The current implementation does not attempt to cache or precompile the picture string. Also it does not detect the error that occurs when the same character is used in more than one role. Error checking has not been thoroughly tested. Changed in 8.2 to allow the empty sequence as the first argument; this behaves as if NaN were supplied. Changed in 8.2 to handle decimals natively, without first converting them to doubles; this means that the full precision can be retained.

xslt:format-number(numeric $value, string $picture, string $decimal-format) → string

Function signature

$value | xs:double ?
$picture | xs:string
$decimal-format | xs:string
Result | xs:string

Formats a number as specified by a picture string, using a named decimal format

XSLT 2.0 Specification

See two-argument version of format-number().

Expand | Up Next