From 47ecbcc2d8fff36a8493571f570361bc41bda61c Mon Sep 17 00:00:00 2001 From: jesus Date: Wed, 20 Nov 2013 19:19:40 +0000 Subject: [PATCH] LazReport, only format numeric values if they are really numeric git-svn-id: trunk@43466 - --- components/lazreport/source/lr_class.pas | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/components/lazreport/source/lr_class.pas b/components/lazreport/source/lr_class.pas index d718e069b4..242c6d952b 100644 --- a/components/lazreport/source/lr_class.pas +++ b/components/lazreport/source/lr_class.pas @@ -8831,13 +8831,17 @@ begin end; fmtNumber: begin - DecimalSeparator := Chr(AFormat and $FF); - case f2 of - 0: Result := FormatFloat('###.##', 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); + if not VarIsNumeric(v) then + result := v + else begin + DecimalSeparator := Chr(AFormat and $FF); + case f2 of + 0: Result := FormatFloat('###.##', 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; fmtDate: