.. _functx_sort-as-numeric:
======================
functx:sort-as-numeric
======================
Sorts a sequence of numeric values or nodes
Description
~~~~~~~~~~~
The functx:sort-as-numeric function sorts a sequence of numeric values or nodes.
This is useful for untyped values, because the order by clause by default treats
values as strings, and would therefore sort 100 before 99.
.. list-table::
:widths: 40 60
:header-rows: 1
* - **Parameters**
- **Description**
* - seq:item()
- the sequence to sort
Examples
~~~~~~~~
.. list-table::
:widths: 50 50
:header-rows: 1
* - **XPath**
- **Results**
* - functx:sort-as-numeric(('1','100','99'))
- ('1', '99', '100')
* - functx:sort-as-numeric($in-xml/*)
- 1 4 35
See Also
~~~~~~~~
.. toctree::
:titlesonly:
:glob:
* :ref:`functx_sort`.
* :ref:`functx_sort-case-insensitive`.
* :ref:`functx_sort-document-order`.