ExCtrls: use Abs() of LValue, not of AValue in TCustomFloatSISpinEditEx.ValueToStr

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7612 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
lazarus-bart 2020-08-17 20:15:42 +00:00
parent c9f05e0289
commit d689407c6f

View File

@ -559,14 +559,15 @@ end;
function TCustomFloatSISpinEditEx.ValueToStr(const AValue: Double): String; function TCustomFloatSISpinEditEx.ValueToStr(const AValue: Double): String;
var var
Prefix: TSIPrefix; Prefix: TSIPrefix;
LValue, Factor: Double; LValue, AbsLValue, Factor: Double;
fs: TFormatSettings; fs: TFormatSettings;
begin begin
LValue := GetLimitedValue(AValue); LValue := GetLimitedValue(AValue);
AbsLValue := Abs(LValue);
for Prefix := Low(SIFactors) to High(SIFactors) do for Prefix := Low(SIFactors) to High(SIFactors) do
begin begin
Factor := SIFactors[Prefix]; Factor := SIFactors[Prefix];
if (abs(AValue) >= Factor) then if (AbsLValue >= Factor) then
begin begin
{$IF LCL_FullVersion < 2010000} {$IF LCL_FullVersion < 2010000}
fs := DefaultFormatSettings; fs := DefaultFormatSettings;