abs

Returns the absolute value of the number represented in decimal.

An error occurs if number is not a valid number.

Syntax

abs(number)
Table 1. abs parameters
Parameter Type Description
number Decimal number Any decimal number.

Returns

A string containing the absolute of the number, or an empty string if an error occurs.

Example

In this example, the result of abs is "2341.23".

   <field sid="absTest">
      <label>Test abs()</label>
      <format>
         <datatype>string</datatype>
         <constraints>
            <mandatory>on</mandatory>
         </constraints>
      </format>
      <value compute="abs('-2341.23')"></value>
   </field>