View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001725||JEDI VCL||00 JVCL Components||public||2004-05-04 23:21||2004-05-28 03:31|
|Target Version||Fixed in Version|
|Summary||0001725: Error "not a valid floating point value" in TJvDBCalcEdit when DecimalSeparator <> '.' like in germany|
|Description||In Germany the ThousandSeparator is '.' and the DecimalSeparator is ','. TJvDBCalcEdit.DataChanged (JvDBControls.pas) produce the errormessage "<value> is not a valid floating point value", because EditText is not converted before passing it to StrToFloat().|
The Bug exists in JCVL3-2004-05-02.
|Tags||No tags attached.|
IMO this is not a bug.
StrToFloat uses the "Currency and date/time formatting variables" in the SysUtils unit to format convert a strings to floating point numbers. This means that your application should set these variables (in this case: DecimalSeparator) to reflect the targeting system, like so (for example):
procedure TMainForm.FormCreate(Sender: TObject);
DecimalSeparator := ',';
Alternatively the application could read the settings of the OS through some API to retain the decimal separator for instance, but I don't know how to do that. A component that could do that: read the locale settings from the OS and set the Borland formatting variables would make a good addition to the JVCL IMO (unless already there of course).
It is not a bug. The error "... is not a valid floating point value" from StrToFloat() comes on debugging, if the inserted value is greater than 999 because of the formating with ThousandSeparator (for example '1.234,56') and then the Exception is shown but only on debugging because of try/except. JVCL works correct because it is just a test if the value is zero.
But it should be possible to prevent the exception with "on EConvertError do begin end;"
> But it should be possible to prevent the exception with
> "on EConvertError do begin end;"
Are you sure? The reason you get an exception when debugging is that you have "Stop on Delphi Exceptions" checked in the Debugger options. I don't think wrapping the exception will have any effect in this case but I could be wrong.
||You are right. Wrapping the exception have no effect.|
|So can we agree that this is unfixable and close the report?|
|2004-05-04 23:21||anonymous||New Issue|
|2004-05-24 06:09||hasse42g||Note Added: 0004339|
|2004-05-26 02:36||anonymous||Note Added: 0004360|
||Note Added: 0004361|
|2004-05-26 23:50||anonymous||Note Added: 0004367|
||Status||new => feedback|
||Note Added: 0004371|
|2004-05-28 03:03||anonymous||Note Added: 0004405|
||Status||feedback => resolved|
||Resolution||open => not fixable|
||Assigned To||=> user72|