I have a decimal field on one of my tables that has the decimals option set to ?. What I've read in the documentation says that having a non-numeric value here should keep it from forcing a specific number of decimals, but when I try to assign a value to this field it is rounding to the nearest whole number.
When I run this the result I get in the table is 1.00.
If I do this instead then I properly get 3.39 in the table and it works like I would expect. I've tried doing this with triggers disabled so I'm sure I don't have some strange code altering it elsewhere.
Can anyone tell me what I've done wrong to have it rounding like this? Is having "?" not the correct way? In my circumstance I am not able to change the decimals attribute in the database since I do not own it.
Field-Name: field1
Data-Type: decimal
Initial: 0
Label: field1
Mandatory: no
Format: ->>,>>9.99
Decimals: ?
Code:
FIND FIRST bTest EXCLUSIVE-LOCK.
ASSIGN bTest.field1 = 1.23.
DISPLAY bTest.field1.
Code:
DEFINE VARIABLE handle AS HANDLE NO-UNDO.
FIND FIRST bTest EXCLUSIVE-LOCK.
ASSIGN handle = BUFFER bTest:BUFFER-FIELD("field1").
ASSIGN handle:BUFFER-VALUE = 3.39.
DISPLAY bTest.field1
Can anyone tell me what I've done wrong to have it rounding like this? Is having "?" not the correct way? In my circumstance I am not able to change the decimals attribute in the database since I do not own it.
Last edited: