NaN (Not A Number) values now are read as '' (nothing) instead as "NaN".

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2760 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
joshy 2013-07-03 00:01:48 +00:00
parent 30bcff1574
commit fa1ffd579f

View File

@ -665,6 +665,10 @@ end;
function TsWorksheet.ReadAsUTF8Text(ARow, ACol: Cardinal): ansistring; function TsWorksheet.ReadAsUTF8Text(ARow, ACol: Cardinal): ansistring;
var var
ACell: PCell; ACell: PCell;
function FloatToStrNoNaN(const Value: Double): ansistring;
begin
if IsNan(Value) then Result:='' else Result:=FloatToStr(Value);
end;
begin begin
ACell := FindCell(ARow, ACol); ACell := FindCell(ARow, ACol);
@ -677,7 +681,7 @@ begin
case ACell^.ContentType of case ACell^.ContentType of
//cctFormula //cctFormula
cctNumber: Result := FloatToStr(ACell^.NumberValue); cctNumber: Result := FloatToStrNoNaN(ACell^.NumberValue);
cctUTF8String: Result := ACell^.UTF8StringValue; cctUTF8String: Result := ACell^.UTF8StringValue;
cctDateTime: Result := SysUtils.DateToStr(ACell^.DateTimeValue); cctDateTime: Result := SysUtils.DateToStr(ACell^.DateTimeValue);
else else