The Problem SolverWIndows Workflow Foundation
HomeShow ChangesEditPrintRecent ChangesSubscriptionsLost and FoundFind ReferencesRename



29-5-2007 21:47:257-12-2006 19:11:45

List all versions

Decimal Rule Condition Error

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

Wiki Usage

This wiki site is supposed to be a shared resource. As a shared resource everyone is encouraged to add new content or modify existing content!

Enjoy the WF wiki.

Recent Topics