Skip to content

TAggregateAvg.GetNodeValue

Calculate the average from aggregated values

Declaration

Source position: fpexprpars.pp line 691

public 
procedure TAggregateAvg.GetNodeValue(var Result: TFPExpressionResult)
                                    ;  override;

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.