function TExposureTimeTag.GetAsString: String;
var
floatVal: Double;
fmt1, fmt2: String;
p: Integer;
begin
floatVal := GetAsFloat;
{ BS 2020 10 04 line 1516 was
if IsNaN(floatVal) then
BS 2020 10 04 }
if FFormatStr = '' then begin
if IsNaN(floatVal) or(FloatVal = 0) then
Result := ''
else if floatVal >= 10 then
Result := Format('%.0fs', [floatVal])
else if floatVal >= 1 then
Result := Format('%.1fs', [floatVal])
else
Result := Format('1/%.0fs', [1.0/floatVal]);
end else
begin
p := pos(';', FFormatStr);
if p > 0 then begin
fmt1 := copy(FFormatStr, 1, p-1);
fmt2 := copy(FFormatStr, p+1, MaxInt);
if floatVal < 1.0 then
Result := Format(fmt1, [1.0/floatVal])
else
Result := Format(fmt2, [floatVal]);
end else
Result := Format(FFormatStr, [floatVal]);
end;
end;