| Description |
If Value has a fractional part, then the value returned is rounded to the nearest integer in the direction of negative infinity.
Therefore negative numbers become larger in absolute value, and positive numbers become smaller.
|
| | Notes | Compare with Round and Truncate.
Static methods are not methods of an object - they are simply class functions or procedures available at any time.
|
|
| Microsoft MSDN Links |
System
System.Decimal
|
|
|
| A simple example |
program Project1;
{$APPTYPE CONSOLE}
var
valueA, valueB : Decimal;
result : Decimal;
begin
valueA := 1.2;
valueB := -1.2;
Console.WriteLine('valueA = {0}', valueA.ToString);
Console.WriteLine('valueB = {0}', valueB.ToString);
Console.WriteLine;
result := System.Decimal.Floor(valueA);
Console.WriteLine('valueA floor = ' + result.ToString);
result := System.Decimal.Floor(valueB);
Console.WriteLine('valueB floor = ' + result.ToString);
Console.ReadLine;
end.
| | Show full unit code | valueA = 1.2
valueB = -1.2
valueA floor = 1
valueB floor = -2
|
| |
|
|
|