View Issue Details

IDProjectCategoryView StatusLast Update
0001725JEDI VCL00 JVCL Componentspublic2004-05-28 03:31
ReporteranonymousAssigned Touser72 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionnot fixable 
Product Version 
Target VersionFixed in Version 
Summary0001725: Error "not a valid floating point value" in TJvDBCalcEdit when DecimalSeparator <> '.' like in germany
DescriptionIn 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.
TagsNo tags attached.

Activities

hasse42g

2004-05-24 06:09

reporter   ~0004339

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);
begin
  DecimalSeparator := ',';
end;

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).

Regards

Hans-Eric Grönlund

anonymous

2004-05-26 02:36

viewer   ~0004360

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;"

Regards

Patrick Ulmer

user72

2004-05-26 03:52

  ~0004361

> 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.

anonymous

2004-05-26 23:50

viewer   ~0004367

You are right. Wrapping the exception have no effect.

user72

2004-05-27 02:45

  ~0004371

So can we agree that this is unfixable and close the report?

anonymous

2004-05-28 03:03

viewer   ~0004405

Yes. Thanks.

Issue History

Date Modified Username Field Change
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
2004-05-26 03:52 user72 Note Added: 0004361
2004-05-26 23:50 anonymous Note Added: 0004367
2004-05-27 00:31 user72 Status new => feedback
2004-05-27 02:45 user72 Note Added: 0004371
2004-05-28 03:03 anonymous Note Added: 0004405
2004-05-28 03:31 user72 Status feedback => resolved
2004-05-28 03:31 user72 Resolution open => not fixable
2004-05-28 03:31 user72 Assigned To => user72