Hello,
Is it possible to control the rounding of the SysComputedColumn::Divide method for creating computed column in a view? I've noticed in AX 2012 when using the divide method, the value seems to be the floor taken to the 6th decimal place. For example, I created a simple table with two columns (Amount and Amount1) and a view which displays the value of both fields and a computed column that divides the two fields. My data set looks like this:
amount ---------------- amount1 --------------- viewfield1
10.0000000000000000 30.0000000000000000 0.3333330000000000
10.0000000000000000 60.0000000000000000 0.1666660000000000
10.0000000000000000 70.0000000000000000 0.1428570000000000
10.0000000000000000 90.0000000000000000 0.1111110000000000
7.0000000000000000 11.0000000000000000 0.6363630000000000
7.0000000000000000 22.0000000000000000 0.3181810000000000
22.0000000000000000 7.0000000000000000 3.1428570000000000
The code in the computed column method is straight forward:
public static server str getDivision()
{
return SysComputedColumn::divide(SysComputedColumn::returnField('myView', 'myDS', 'Amount'), SysComputedColumn::returnField('myView', 'myDS', 'Amount1'));
}
It seems that the SysComputedColumn::divide function divides the numbers and takes the floor after the 6th decimal. Is there any way to control the rounding here? I'd like to round the result at 10 decimal places instead of taking the floor at the 6th.