Decimal Rule Condition Error
Last changed: -80.126.16.139

.
Summary

RuleConditions can have problems when using decimal types and comparing them to constant values.

If you use an expression like: this.CurrentOrder.TotalOrderAmount < 29.99

you may receive the following error: Error building condition: Relational operator "LessThan" cannot b e used on operands of types "decimal" and "double".

This is caused by the 29.99 being interpreted as a double instead of a decimal. As there are no comparison operators between decimal and double this results in an error. You can work around the error by adding a "m" to the constant forcing it to be a decimal instead of a double.

So use: this.CurrentOrder.TotalOrderAmount < 29.99m