Returns the denied value of the number, so it returns the numerical value with the opposite sign. If the value is NULL,
it will return NULL. In the case that it is a decimal type is used the function negate() of the BigDecimal class. If not, it is applied a negative
sign in front of the value to obtain the opposite sign.
1 eval.neg
<eval.neg>
<value /> !
</eval.neg>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Evalue |
Returns | |
---|---|
Type | Description |
Number | Returns NULL is the value is NULL. The value with the opposite sign. |
Exceptions
neg not valid for type
The past value is not a number.
Example
Copy
<xsql-script name='sample'> <body> <!-- neg null: null --> <println><eval.neg><null /></eval.neg></println> <!-- neg 98.9: -98.0 --> <println><eval.neg>98.9</eval.neg></println> </body> </xsql-script>
Returns:
Copy
null -98.9