From b44d85767bb880a22f2486686d61cd5ad2319a0f Mon Sep 17 00:00:00 2001 From: alexs75 Date: Sat, 4 Aug 2012 17:31:52 +0000 Subject: [PATCH] minor fix for calc total function in RxDBGrid - tnx ronin git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2484 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/rxdbgrid.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/rx/rxdbgrid.pas b/components/rx/rxdbgrid.pas index 927b50158..bd8508ab8 100644 --- a/components/rx/rxdbgrid.pas +++ b/components/rx/rxdbgrid.pas @@ -3929,10 +3929,12 @@ begin case FValueType of fvtSum: begin - if F.OldValue <> null then - FTestValue := FTestValue - Float(F.OldValue); if not F.IsNull then + begin + if F.OldValue <> null then + FTestValue := FTestValue - Float(F.OldValue); FTestValue := FTestValue + F.AsFloat; + end; end; fvtMax: if not F.IsNull then FTestValue := Max(FTestValue, F.AsFloat);