Export (0) Print
Expand All

Decimal

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Allows for entry of numeric values with a configurable number of decimal places. The following properties are available:

Decimal propertiesTypeDescription
{Field}.DataValueDecimal or NullGet/set property.

The original value is left unchanged if the new value cannot be parsed.

{Field}.MinIntegerGet property.

Returns the minimum allowed value.

{Field}.MaxIntegerGet property.

Returns the maximum allowed value.

{Field}.PrecisionIntegerGet property.

Returns the number of digits allowed. This is a value between 0 and 10.


Example

The following code example shows how to use a field of type Decimal.

var oField = crmForm.all.SOME_DECIMAL_FIELD_ID;

var iValue = 1976.1102;

// Set the precision of the value.
var oNumber = new Number(iValue);
iValue = oNumber.toPrecision(oField.Precision);

if (iValue < oField.Min)
{
   iValue = oField.Min;
}
else if (iResponse > oField.Max)
{
   iValue = oField.Max;
}

oField.DataValue = iValue;

See Also

Concepts

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft