smusba
30th January 2011, 10:32
Dear All,

I want to round off the value

max1.qty = max1.qty + ((tdsfl101.qana)-(((tdsfl100.wast*tdsfl101.quan*0.01)*(0.05))-((tdsfl100.wast*tdsfl101.qana*0.01))))

min1.qty = min1.qty + ((tdsfl101.qana)-(((-tdsfl100.wast*tdsfl101.quan*0.01)*(0.05))+((tdsfl100.wast*tdsfl101.qana*0.01))))

For Example,

tdsfl101.qana = 10
tdsfl100.wast = 5
tdsfl101.quan = 10

so it becomes
Max.qty = 10.475 round of value should be 10.5
min.qty = 9.525 round of value should be 9.5

bdittmar
30th January 2011, 12:13
Dear All,

I want to round off the value

max1.qty = max1.qty + ((tdsfl101.qana)-(((tdsfl100.wast*tdsfl101.quan*0.01)*(0.05))-((tdsfl100.wast*tdsfl101.qana*0.01))))

min1.qty = min1.qty + ((tdsfl101.qana)-(((-tdsfl100.wast*tdsfl101.quan*0.01)*(0.05))+((tdsfl100.wast*tdsfl101.qana*0.01))))

For Example,

tdsfl101.qana = 10
tdsfl100.wast = 5
tdsfl101.quan = 10

so it becomes
Max.qty = 10.475 round of value should be 10.5
min.qty = 9.525 round of value should be 9.5

Hello,

round()
Syntax:

function double round (double value, long diga, long mode)

Description


This rounds a given value to a specified number of decimal places.


Arguments

double value The value to be rounded.

long diga The number of decimal places to which value is to be rounded.

long 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.

Before posting those basic questions, have a look at your DEV-Guide or http://www.baanboard.com/programmers_manual_baanerp_TopicList_R, please


Regards