Sign in Join
FPDoc Onlineexperiment

RoundTo function

In unit Math

Round to the specified number of digits.

Declaration

pascal
function RoundTo(const AValue: Double; const Digits: TRoundToRange)
: Double

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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.