OBJECT Codeunit 79438 Mysterious Bug { OBJECT-PROPERTIES { Date=29.08.09; Time=09:03:48; Modified=Yes; Version List=; } PROPERTIES { OnRun=BEGIN recRef.OPEN(DATABASE::Item); fldRef := recRef.FIELD(18); // "Unit Price" fldRef.VALUE := 1.23456; varVar := fldRef.VALUE; // varVar is DataType Variant MESSAGE('The fldRef.VALUE is %1, but the varVar value is %2!',fldRef.VALUE,varVar); END; } CODE { VAR recRef@1000000002 : RecordRef; fldRef@1000000003 : FieldRef; varVar@1000000001 : Variant; BEGIN END. } }If you run this codeunit, the message will give you 1.2346 instead of 1.23456 for the value of the variant variable. It seems to be that during the assignment of the varVar variable the result is rounded to 4 decimal places, regardless of the original value.
Comments
Which version (and build) are you using?
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I had the problem with a decimal in 3.60 that was solved in 3.70.
Seems they never fixed it for variants.
Better report it to Microsoft!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!