format-number

format-number($value as numeric?, $picture as xs:string) → xs:string

Arguments

 

$value

numeric?

The number to be formatted

 

$picture

xs:string

Picture showing how the number is to be formatted

Result

xs:string

format-number($value as numeric?, $picture as xs:string, $decimal-format-name as xs:string) → xs:string

Arguments

 

$value

numeric?

The number to be formatted

 

$picture

xs:string

Picture showing how the number is to be formatted

 

$decimal-format-name

xs:string

Name of a decimal format definition defined in the context

Result

xs:string

Links to W3C specifications

Namespace: http://www.w3.org/2005/xpath-functions

Applies to: XPath 2.0, XSLT 2.0, XQuery 1.0 and later versions

XPath 2.0 Functions and Operators

XPath 3.0 Functions and Operators

Notes on the Saxon implementation

From Saxon 9.3 this becomes available for XPath/XQuery as well as XSLT. The query prolog declarations for defining a decimal format in XQuery become available in Saxon 9.4.