From c9f05e0289e52df0125daef03e475292cfdd1335 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 17 Aug 2020 16:39:40 +0000 Subject: [PATCH] ExCtrls/TcustomFloatSISpinEditEx: Fix incorrect version check. Fix incorrect handling of negative values. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7611 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/exctrls/source/exeditctrls.pas | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/exctrls/source/exeditctrls.pas b/components/exctrls/source/exeditctrls.pas index bcbe568cb..ab1a8c8d7 100644 --- a/components/exctrls/source/exeditctrls.pas +++ b/components/exctrls/source/exeditctrls.pas @@ -560,17 +560,15 @@ function TCustomFloatSISpinEditEx.ValueToStr(const AValue: Double): String; var Prefix: TSIPrefix; LValue, Factor: Double; - {$IF LCL_FullVersion >= 2010000} fs: TFormatSettings; - {$IFEND} begin LValue := GetLimitedValue(AValue); for Prefix := Low(SIFactors) to High(SIFactors) do begin Factor := SIFactors[Prefix]; - if (AValue >= Factor) then + if (abs(AValue) >= Factor) then begin - {$IF LCL_FullVersion >= 2010000} + {$IF LCL_FullVersion < 2010000} fs := DefaultFormatSettings; fs.DecimalSeparator := DecimalSeparator; //fs.ThousandSeparator := ThousandSeparator;