Sign in Join
FPDoc Onlineexperiment

TAggregateAvg.GetNodeValue procedure

Member of TAggregateAvgpublicIn unit fpExprPars

Calculate the average from aggregated values

Declaration

pascal
procedure GetNodeValue(var Result: TFPExpressionResult); override

Arguments

Result

Returns the calculated average

Description

The GetNodeValue method calculates and returns the final average value by dividing the accumulated sum by the count of processed values. It overrides the base class behavior to provide average-specific result calculation.

The method handles edge cases such as division by zero (when no values have been processed) and ensures appropriate result type conversion based on the input data types.

The returned result is a TFPExpressionResult containing the calculated average as a floating-point value.

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