Bug in expression - Exception thrown
Hi,
how can I fix the following error (LIGN_DEBI is a parameter of DataType=Decimal and which contains a correct value).
this runs fine :
how can I fix the following error (LIGN_DEBI is a parameter of DataType=Decimal and which contains a correct value).
this runs fine :
This discussion has been closed.
Comments
Hello!
Mixing `decimal` and `double`: In C#, literals with a decimal point, such as 1.5, are of type double, and the expression [LIGN_DEBI] / 1.5 does not compile (Operator ‘/’ cannot be applied to operands of type ‘decimal’ and ‘double’). Add the m suffix: [LIGN_DEBI] / 100m or 1.5m.
Comparing or dividing an untyped value by zero: When dividing, check the denominator using a short ternary operator [([LIGN_DEBI] == 0m ? 0m : ...)] or wrap it in ToDecimal([LIGN_DEBI])