File: rs-cnum.rst

package info (click to toggle)
rsyslog-doc 8.2302.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,464 kB
  • sloc: python: 178; makefile: 8
file content (36 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (2)
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
******
cnum()
******

Purpose
=======

cnum(expr)

Converts expr to a number (integer).

.. note::

   If the expression does not contain a numerical value, the following
   rule applies: the best match as the number is returned. For example
   "1x234" will return the number 1 and "Test123" will return 0. Zero is
   always returned if the there is no number at the start of the string.
   This also is the case for empyt strings.


Example
=======



.. code-block:: none

   cnum(3+2);

produces

.. code-block:: none

   5