LazReport, only format numeric values if they are really numeric

git-svn-id: trunk@43466 -
This commit is contained in:
jesus 2013-11-20 19:19:40 +00:00
parent b5772a5157
commit 47ecbcc2d8

View File

@ -8831,13 +8831,17 @@ begin
end; end;
fmtNumber: fmtNumber:
begin begin
DecimalSeparator := Chr(AFormat and $FF); if not VarIsNumeric(v) then
case f2 of result := v
0: Result := FormatFloat('###.##', v); else begin
1: Result := FloatToStrF(Extended(v), ffFixed, 15, (AFormat div $0100) and $FF); DecimalSeparator := Chr(AFormat and $FF);
2: Result := FormatFloat('#,###.##', v); case f2 of
3: Result := FloatToStrF(Extended(v), ffNumber, 15, (AFormat div $0100) and $FF); 0: Result := FormatFloat('###.##', v);
4: Result := FormatFloat(AFormatStr, v); 1: Result := FloatToStrF(Extended(v), ffFixed, 15, (AFormat div $0100) and $FF);
2: Result := FormatFloat('#,###.##', v);
3: Result := FloatToStrF(Extended(v), ffNumber, 15, (AFormat div $0100) and $FF);
4: Result := FormatFloat(AFormatStr, v);
end;
end; end;
end; end;
fmtDate: fmtDate: