DecimalNvlExpression

What it is

DecimalNvlExpression is used specify how to treat a NULL value in a Decimal property (or field or variable). If the Decimal appears to be NULL, it will be assigned a default value or a specified value.

Code example

public ReadOnlyDecimalProperty DecimalNvlExample
{
	get 
	{ 
		return CalculatedDecimalProperty(() => 
			Operation.EditItem.Number.Nvl()); 
	}
}

 

Explanation of the example

The example above works as follows.

  • Line 1 defines a ReadOnlyDecimalProperty with the name DecimalNvlExample.
  • In Line 5 and 6 the content of this property is going to be calculated and assigned.
  • In line 6, the Decimal Operation.EditItem.Number is evaluated, by adding .Nvl.
  • If the Decimal appears to be NULL, then DecimalNvlExample will be assigned the value after Nvl between parentheses. When nothing is specified, the default value will be zero (0).