RoundTo
Round to the specified number of digits
Declaration
Source position: math.pp line 294
function RoundTo(const AValue: Double; const Digits: TRoundToRange)
: Double;
function RoundTo(const AVAlue: Extended; const Digits: TRoundToRange)
: Extended;
function RoundTo(const AValue: Single; const Digits: TRoundToRange)
: Single;
Description
RoundTo rounds the specified float AValue to the specified number of digits and returns the result. This result is accurate to "10 to the power Digits". It uses the standard Round function for this.
Errors
An exception may occur if the value AValue is not inside a valid integer (or Int64) range.
See also
Name | Description |
---|---|
SetRoundMode | Set the Floating Point Unit rounding mode. |
SimpleRoundTo | Round to the specified number of digits (rounding up if needed) |
TFPURoundingMode | Type describing the rounding mode for the Floating Point processor. |
TRoundToRange | Range with valid range of digits in RoundTo |