G
Guest
Hi,
I need to compute a percentage in a DataTable, so i'm trying to use the Expression property provided by the DataColumn object. My problem is the classic division by zero error.
This is my expression:
"IIF(budget_ext_price = 0, 'NaN', material_margin / budget_ext_price)"
Now, it seems that the material_margin / budget_ext_price expression is being evaluated regardless of the condition. If i replace the '/' with '-', I get correctly NaN in one row, though with '/' I get division by zero exception. Is the false part really being evaluated, even in the case the condition is true?
I need to compute a percentage in a DataTable, so i'm trying to use the Expression property provided by the DataColumn object. My problem is the classic division by zero error.
This is my expression:
"IIF(budget_ext_price = 0, 'NaN', material_margin / budget_ext_price)"
Now, it seems that the material_margin / budget_ext_price expression is being evaluated regardless of the condition. If i replace the '/' with '-', I get correctly NaN in one row, though with '/' I get division by zero exception. Is the false part really being evaluated, even in the case the condition is true?