View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006114 | JEDI VCL | 00 JVCL Components | public | 2013-04-02 18:45 | 2014-12-04 16:28 |
Reporter | cguser | Assigned To | obones | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | suspended | ||
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | ||||
Summary | 0006114: TJvValidateEdit: Issues with DisplayFormat of dfFloat | ||||
Description | Changing FormatSettings.DecimalSeparator makes the value bigger by 1000 factor. {code} TJvValidateEdit *ed = new TJvValidateEdit(this); ed->Parent = this; ed->DisplayFormat = dfFloat; ed->DecimalPlaces = 3; // TJvValidateEdit was created when // FormatSettings.DecimalSeparator was still == '.' // However, if some component (like eg. MultiLizer) changes this // after (eg: form?) creation into FormatSettings.DecimalSeparator = ',' // values are now multiplied by 1000. // Example: FormatSettings.DecimalSeparator = ','; ed->AsFloat = 1; if (ed->AsFloat == 1000) ShowMessage("Error!"); // it is now off by a factor of 1000 {code} Related to case 0005579. Sorry for not reporting before, but only now while testing XE3, the issue came back (without previous manual fix of 0005579). | ||||
Additional Information | Setting the third parameter of all calls on JvValidateEdit.pas to JvSafeStrToFloatDef as {$IFDEF RTL220_UP}FormatSettings.{$ENDIF RTL220_UP}DecimalSeparator does solve this. | ||||
Tags | No tags attached. | ||||
related to | 0006178 | closed | Can't delete "0" char on TJvValidateEdit |
|
Btw, tested with the latest svn version (13502): http://jvcl.svn.sourceforge.net/viewvc/jvcl/trunk/jvcl/run/JvValidateEdit.pas?revision=13502 |
|
The provided code sample on the Description has been solved on 0004682 (seemed familiar alright), through RecalcCheckChars. However, the current issue does not *require* a change of FormatSettings.DecimalSeparator *after* component creation, eg: {code} assert(FormatSettings.DecimalSeparator == '.'); // pass assert(GetLocaleChar(LOCALE_SYSTEM_DEFAULT, LOCALE_SDECIMAL, FormatSettings.DecimalSeparator) == '.'); // pass assert(GetLocaleChar(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, FormatSettings.DecimalSeparator) == '.'); // pass // Let's say Multilizer changes DecimalSeparator into ',': FormatSettings.DecimalSeparator = ','; TJvValidateEdit *ed = new TJvValidateEdit(this); ed->Parent = this; ed->DisplayFormat = dfFloat; ed->DecimalPlaces = 3; ed->AsFloat = 1; assert(ed->AsFloat == 1.0); // fails, because now ed->AsFloat == 1000 {code} |
|
Just noticed that {$IFDEF RTL220_UP}FormatSettings.{$ENDIF RTL220_UP}DecimalSeparator has been deprecated around the code, being replaced instead with JclFormatSettings.DecimalSeparator Therefore, setting the *third* parameter of all calls on JvValidateEdit.pas to JvSafeStrToFloatDef as JclFormatSettings.DecimalSeparator does solve this once and for all (hopefully). |
|
Please try with the latest JVCL version in GIT (or daily zip) and then send us a zipped file containing the sources of an application showing the issue. |
|
No news, suspending the issue |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-04-02 18:45 | cguser | New Issue | |
2013-04-02 18:47 | cguser | Note Added: 0020458 | |
2013-04-03 11:26 | cguser | Note Added: 0020459 | |
2013-04-03 12:15 | cguser | Note Added: 0020460 | |
2013-08-31 04:20 | Arioch | Relationship added | related to 0006178 |
2013-12-13 10:50 | obones | Note Added: 0020720 | |
2013-12-13 10:50 | obones | Status | new => feedback |
2014-12-04 16:28 | obones | Note Added: 0021102 | |
2014-12-04 16:28 | obones | Status | feedback => resolved |
2014-12-04 16:28 | obones | Resolution | open => suspended |
2014-12-04 16:28 | obones | Assigned To | => obones |