1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2018 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-->
<refentry id="fn_xslt_format_number">
<refmeta>
<refentrytitle>xslt_format_number</refentrytitle>
<refmiscinfo>xml</refmiscinfo>
</refmeta>
<refnamediv>
<refname>xslt_format_number</refname>
<refpurpose>returns formatted string representation of a numeric value</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_xslt_format_number">
<funcprototype id="fproto_xslt_format_number">
<funcdef><function>xslt_format_number</function></funcdef>
<paramdef><parameter>number</parameter> any</paramdef>
<paramdef><parameter>format_string</parameter> varchar</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc"><title>Description</title>
<para>xslt_format_number is an function wrapper for the format-number() XSLT function.</para>
<para>It always uses the default formatting parameters described in the XSLT standard.</para>
</refsect1>
<refsect1 id="params"><title>Parameters</title>
<refsect2><title><parameter>number</parameter></title>
<para>
<type>integer</type>, <type>numeric</type> or <type>string</type>.
</para>
</refsect2>
<refsect2><title><parameter>format_string</parameter></title>
<para><type>string</type></para>
</refsect2>
</refsect1>
<refsect1 id="ret"><title>Return Values</title>
<para>An <type>string</type> representation of the numeric value of <parameter>number</parameter> converted according to the format <parameter>format_string</parameter>.</para>
</refsect1>
<refsect1 id="examples"><title>Examples</title>
<example id="ex_fn_xslt_format_number_1"><title>Simple examples</title>
<screen>
xslt_format_number (5351, '#,###'), 5,351
xslt_format_number ('5351', '#.00'), 5351.00
xslt_format_number (53.51, '#.0000'), 53.5100
xslt_format_number (53.51, '0000.0000'), 0053.5100
xslt_format_number (53.51, '0000.####'), 0053.51
xslt_format_number (53.56, '0.0'); 53.6
</screen>
</example>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para><link linkend="dtcasting">casting</link></para>
</refsect1>
</refentry>
|