View Issue Details

IDProjectCategoryView StatusLast Update
0003484JEDI VCL00 JVCL Componentspublic2008-02-21 03:19
ReporterBrunoTAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionsuspended 
Product Version3.10 
Target VersionFixed in Version 
Summary0003484: JvValidateEdit interprets very large & very small values incorrectly
DescriptionA very little difference was returned from a operation

//eg. 183,03-Round(183,03*100)/100 //

2.842170943e-14

JvValidateedit.Value interprets it as "2.84"

Additional InformationDecimalPlaces = 2
Displayformat = dfFloat
TagsNo tags attached.

Relationships

has duplicate 0003768 closed Scientific value 

Activities

2006-02-01 00:00

 

JvValidateEdit_bug.jpg (9,935 bytes)
JvValidateEdit_bug.jpg (9,935 bytes)

elahn

2006-02-02 02:02

developer   ~0008489

SysUtils.FloatToStr returns a string containing an 'E' for very large or very small values. When (DisplayFormat = dfFloat) TJvCustomValidateEdit.MakeValid strips the 'E-' out of the string. This issue affects [dfFloat, dfCurrency, dfPercent].

Use DisplayFormat = dfScientific to display these values correctly.



Off Topic: There may be a bug in your code...in the following snippet, I assume that "," is your locale equivalent of "."

//eg. 183,03-Round(183,03*100)/100 //

183.03 * 100 = 18303
Round(18303) = 18303
18303 / 100 = 183.03
183.03 - 183.03 = 0

The result of that expression would be zero, not 2.842170943e-14

BrunoT

2006-02-02 02:39

reporter   ~0008490

This Part was different to version 3.00, isn´t it?

This: //eg. 183,03-Round(183,03*100)/100 // was an incomplete code- part.;)

I truncat the numbers after two decimals befor I send it to JvValidateEdit.Value.

Thanks for the fast answer.

obones

2006-04-05 05:19

administrator   ~0008957

elahn, any opinion on the actions to take here?

elahn

2006-04-05 07:19

developer   ~0008994

I've just fixed (in CVS) the issue for small values, but I don't know what to do about large ones.

Once the number of digits to the left of the decimal point is greater than 18, it gets displayed in scientific format & thus mishandled.

Also, some strange things happen at 17 and 18 digits, e.g. "12,345,678,901,234,567" gets replaced with "12,345,678,901,234,568" if (DecimalPlaces = 0), but if (DecimalPlaces = 10) then it gets replaced with "12,345,678,901,234,566".

obones

2006-06-08 02:02

administrator   ~0009417

Any news on this?

elahn

2006-06-08 10:03

developer   ~0009498

Nope.

obones

2008-02-21 03:17

administrator   ~0014207

This issue is too old, many changes have been done in between. Should this still be applicable, please create a new issue after having tested using the latest JVCL

Issue History

Date Modified Username Field Change
2006-02-01 00:00 BrunoT New Issue
2006-02-01 00:00 BrunoT File Added: JvValidateEdit_bug.jpg
2006-02-02 02:02 elahn Note Added: 0008489
2006-02-02 02:02 elahn Status new => confirmed
2006-02-02 02:04 elahn Summary JvValidateEdit interprets a false Value => JvValidateEdit interprets very large & very small values incorrectly
2006-02-02 02:04 elahn Description Updated
2006-02-02 02:39 BrunoT Note Added: 0008490
2006-04-05 05:19 obones Note Added: 0008957
2006-04-05 05:19 obones Status confirmed => feedback
2006-04-05 07:19 elahn Note Added: 0008994
2006-04-12 01:06 obones Status feedback => confirmed
2006-06-08 02:02 obones Note Added: 0009417
2006-06-08 10:03 elahn Note Added: 0009498
2006-06-20 01:05 obones Relationship added has duplicate 0003768
2008-02-21 03:17 obones Status confirmed => closed
2008-02-21 03:17 obones Note Added: 0014207
2008-02-21 03:19 obones Resolution open => suspended