bluetenders
15th July 2005, 09:16
Hi!
I want to round off a data type DOUBLE to 8 decimal place. It seems that double datatype automatically round off to 6decimal place. Is there any data type for me to round off to 8 decimal place?
Thanks!
mr_suleyman
15th July 2005, 14:12
Hello There ,
For round operation in baan , maximum round value is 6 . I think that your problem is impossible.
Good luck ...
Moon Lok
16th July 2005, 04:43
I haven't try it but first image in my mind is
round(<doublevalue>*100,6,2)/100
Hope my idea can help.
bluetenders
16th July 2005, 04:57
hi!
Thanks...
bluetenders
16th July 2005, 05:07
Hi Moon lok!
Thanks!
what i mean is even if you set the domain for this fieldtype double ( Example-- Nos. (after dec.sign) is 8). Then in report printing, data for this field is automatically round off to 6 as what Mr. Suleyman said. the last 2 digit will be automatically zero. (Ex.. 1234.12345678-- result will be automatically 1234.12345700 eventhough you did not set any round off function)...
Moon Lok
16th July 2005, 06:33
Sorry for the mis-understanding you question.
I have tested the condition you mentioned. And would like to suggest you to print the value as string in the report layout with below manipulation method.
test.data double
test.data1 string(20)
test.data = 12345.123456789
test.data1 = shiftr$(sprintf$("%@ZZZZZZZZ9@",round(test.data,0,1)))&"."&shiftl$(sprintf$("%@99999999@",(test.data - round(test.data,0,1))*100000000))
May be it is too complicate, you may simplify it in your own method.
bluetenders
26th July 2005, 10:00
Thank you very much!
Giovanni27
1st June 2010, 16:20
Hello!
I'm having a problem with round a double data
Actually I have:
variable_double = table.field * 100
variable_double = 158.9
How can I do if I want round the field to 159
bdittmar
1st June 2010, 17:31
Hello!
I'm having a problem with round a double data
Actually I have:
variable_double = table.field * 100
variable_double = 158.9
How can I do if I want round the field to 159
Hello,
BaanERP Programmers Guide
round()
--------------------------------------------------------------------------------
Syntax
double round( double value, long diga, long mode )
Description
This rounds a given value to a specified number of decimal places.
Arguments
value
The value to be rounded.
diga
The number of decimal places to which value is to be rounded.
mode
0 truncate (for example, both 1.5 and 1.49 are rounded down to 1)
1 normal round (for example, 1.5 is rounded up to 2; 1.49 is rounded
down to 1)
2 round up (for example, both 1.5 and 1.49 are rounded up to 2)
Return values
The rounded value. Or the original value (value) if an error occurs.
Because the return value is of type double, the number of digits after the decimal sign is always 6. For example, round(1.345, 2, 1) returns 1.350000.
Regards
Giovanni27
2nd June 2010, 16:24
thanks a lot, Bernd!!!
You cleared my doubts! :D
Regards! :)