.. _format-number: ============= format-number ============= Formata um número Descrição ~~~~~~~~~ A função fn:format-number formata $value como string, usando a máscara indicada em $picture e o $decimal-format-name, ou o formato decimal padrão, se não houver o argumento $decimal-format-name. A sintaxe da máscara está na seção 16.4.2 da recomendação XSLT 2.0. Observação: é uma função só do XSLT; não existe em XQuery nem em XPath puro. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parâmetros** - **Descrição** * - value:numeric() - o número a formatar * - picture:string() - a máscara, como #,##0.00 * - decimal-format-name:string() - o nome de um xsl:decimal-format; opcional Exemplos ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Resultado** * - format-number(1234.5, '#,##0.00') - 1,234.50 * - format-number(0.25, '0%') - 25% * - format-number(12, '000') - 012 * - format-number(3.14159, '0.##') - 3.14 Veja também ~~~~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_pad-integer-to-length`.