System.Abs(Decimal) Method
Version: Available or changed with runtime version 1.0.
Calculates the absolute value of a number (Decimal, Integer or BigInteger). ABS always returns a positive numeric value or zero.
Syntax
NewNumber := System.Abs(Number: Decimal)
Note
This method can be invoked without specifying the data type name.
Parameters
Number
Type: Decimal
The input value.
Return Value
NewNumber
Type: Decimal
Remarks
The system automatically converts all of the numeric data types for you.
Example
This example shows how to remove the sign from a negative numeric value.
var
x: Decimal;
y: Decimal;
Text000: Label "x = %1, y = %2";
begin
x := -10.235; // x is assigned a negative value
y := ABS(x); // y is assigned the value of x without sign
Message(Text000, x, y);
end;
The message window displays the following:
x = -10.235, y = 10.235
See Also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈