Share via


COMVariant.decimal Method

Definition

Overloads

decimal(Decimal)
decimal()

Gets or sets the value of a COMVariant object of the VT_DECIMAL data type.

decimal(Decimal)

public:
 virtual System::Decimal decimal(System::Decimal _newValue);
public virtual decimal decimal (decimal _newValue);
abstract member decimal : decimal -> decimal
override this.decimal : decimal -> decimal
Public Overridable Function decimal (_newValue As Decimal) As Decimal

Parameters

_newValue
Decimal

The new value; optional.

Returns

Applies to

decimal()

Gets or sets the value of a COMVariant object of the VT_DECIMAL data type.

public:
 virtual System::Decimal decimal();
public virtual decimal decimal ();
abstract member decimal : unit -> decimal
override this.decimal : unit -> decimal
Public Overridable Function decimal () As Decimal

Returns

The current value.

Remarks

If you pass in a value that has a different data type than the object, the data type of the object will be changed to match the data type of the value. A COMVariant object has a decimal type if its data type is set to COMVariantType::VT_DECIMAL. The decimal data type is a COM data type that provides size and scale for a number. There is no parallel to the decimal data type in X++.

The following example creates a new COMVariant object of type VT_DECIMAL and sets the value to 123.456.

{ 
    COMVariant var = new COMVariant( 
        COMVariantInOut::IN_OUT,  
        COMVariantType::VT_DECIMAL); 
    // Set value of the object 
    var.decimal(123.456); 
}

Applies to