From: <ob...@us...> - 2008-12-22 13:50:47
|
Revision: 12088 http://jvcl.svn.sourceforge.net/jvcl/?rev=12088&view=rev Author: obones Date: 2008-12-22 13:50:38 +0000 (Mon, 22 Dec 2008) Log Message: ----------- Mantis 4604: JvCsvStrToFloat should always have been given GetDecimalSeparator and not GetSeparator, the latter being the field separator. Modified Paths: -------------- trunk/jvcl/run/JvCsvData.pas Modified: trunk/jvcl/run/JvCsvData.pas =================================================================== --- trunk/jvcl/run/JvCsvData.pas 2008-12-22 13:42:23 UTC (rev 12087) +++ trunk/jvcl/run/JvCsvData.pas 2008-12-22 13:50:38 UTC (rev 12088) @@ -1706,7 +1706,7 @@ sFieldValue := _Dequote(sFieldValue); // remove quotes. //sFieldValue := UpperCase(sFieldValue); // pointless on numerics try - FieldValue := JvCsvStrToFloat(string(sFieldValue), GetSeparator); // remember, this baby throws EConvertError on exception! + FieldValue := JvCsvStrToFloat(string(sFieldValue), GetDecimalSeparator); // remember, this baby throws EConvertError on exception! // if { FieldValue [ = <> > < ] numValue } then.... if JvCsvNumCondition(FieldValue, compareOperator, numValue) then // hide row if not same prefix @@ -2009,7 +2009,7 @@ { Default CLASSIC behaviour of this component is to encode outgoing data in US format regardless of system regional settings. This has become more flexible now, but we still default at designtime-defaults to using a DOT. } - Result := JvCsvStrToFloat( string(TempString), GetSeparator ); + Result := JvCsvStrToFloat( string(TempString), GetDecimalSeparator ); ftBoolean: if StrToIntDef(string(TempString), 0) <> 0 then @@ -2913,7 +2913,7 @@ PInteger(Buffer)^ := StrToInt(string(TempString)); // Standard Double-precision Float conversion: ftFloat: - PDouble(Buffer)^ := JvCsvStrToFloat(string(TempString),GetSeparator); // was StrToFloatUS + PDouble(Buffer)^ := JvCsvStrToFloat(string(TempString),GetDecimalSeparator); // was StrToFloatUS ftBoolean: if TempString = '' then PInteger(Buffer)^ := 0 @@ -3999,8 +3999,8 @@ case Column^.FFlag of jcsvNumeric: begin - NumLeft := JvCsvStrToFloatDef( string(StrLeft), -99999.9, GetSeparator); - NumRight := JvCsvStrToFloatDef( string(StrRight), -99999.9, GetSeparator); + NumLeft := JvCsvStrToFloatDef( string(StrLeft), -99999.9, GetDecimalSeparator); + NumRight := JvCsvStrToFloatDef( string(StrRight), -99999.9, GetDecimalSeparator); Diff := NumLeft - NumRight; if Diff < -0.02 then Result := -1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |