Returns the absolute value of the specified decimal .
- value
- A decimal.
A decimal containing the absolute value of value.
Documentation for this section has not yet been entered.
The following example demonstrates the Math.Abs(sbyte)(decimal) method.
C# Example
using System; public class MathAbsExample { public static void Main() { Decimal d1 = Math.Abs( (Decimal)0.00 ); Decimal d2 = Math.Abs( (Decimal)(-1.23) ); Console.WriteLine("Math.Abs( (Decimal)0.00 ) returns {0}",d1); Console.WriteLine("Math.Abs( (Decimal)(-1.23) ) returns {0}",d2); } }The output is
Math.Abs( (Decimal)0.00 ) returns 0
Math.Abs( (Decimal)(-1.23) ) returns 1.23
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0