# MTDecimalOps

Object that provides methods to create decimal values and performs mathematical operations with them.

## Program ID

MTDecimalOps.MTDecimalOps.1

## MTDecimalOps Methods

Abs | Returns the absolute value of the argument. Currently not implemented.
Add | Returns the sum of the arguments.
Compare | Returns a comparison of the two arguments.
Create | Creates a decimal value out of the argument.
Divide | Returns the first argument divided by the second.
EQ | Returns true if first argument is equal to second.
Fix | Returns the integer portion of the argument. If the value of the variant is negative, then the first negative integer greater than or equal to the variant is returned.
GE | Returns true if first argument is greater than or equal to the second.
GT | Returns true if first argument is greater than the second.
Int | Returns the integer portion of the argument. If argument is negative, then the first negative integer less than or equal to the argument is returned.
LE | Returns true if first argument is less than or equal to the second.
LT | Returns true if first argument is less than the second.
Multiply | Returns the product of the arguments.
NE | Returns true if first argument is not equal to second.
Negate | Returns the logical negative of the argument.
Round | Rounds the argument to the given number of decimal places.
Subtract | Returns the difference of the arguments.

## Example

Example to be provided in a future release of this online help system.

# Method Detail

## Add

Returns the sum of the arguments.

### Visual Basic Syntax

Function Add(Val1, Val2)

### C++ Syntax

HRESULT Add([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT * pResult);

### Arguments

Numbers to add

### Return Value

Result of addition

## Subtract

Returns the difference of the arguments.

### Visual Basic Syntax

Function Subtract(Val1, Val2)

### C++ Syntax

HRESULT Subtract([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT* pResult);

### Arguments

Numbers to subtract

### Return Value

Result of subtraction

## Multiply

Returns the product of the arguments.

### Visual Basic Syntax

Function Multiply(Val1, Val2)

### C++ Syntax

HRESULT Multiply([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT * pResult);

### Arguments

Numbers to multiply

### Return Value

Result of multiplication

## Divide

Returns the first argument divided by the second.

### Visual Basic Syntax

Function Divide(Val1, Val2)

### C++ Syntax

HRESULT Divide([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT * pResult);

### Arguments

Numbers to divide

### Return Value

Result of division

## Abs

Returns the absolute value of the argument. Currently not implemented.

### Visual Basic Syntax

Function Abs(Value)

### C++ Syntax

HRESULT Abs([in] VARIANT Value, [out, retval] VARIANT * pResult);

### Arguments

Value

Number of applied absolute values

### Return Value

Result of absolute value

## Int

Returns the integer portion of the argument. If argument is negative, then the first negative integer less than or equal to the argument is returned.

### Visual Basic Syntax

Function Int(Value)

### C++ Syntax

HRESULT Int([in] VARIANT Value, [out, retval] VARIANT * pResult);

### Arguments

Value

Number to take integer portion

### Return Value

Result of fixed computation

## Negate

Returns the logical negative of the argument.

### Visual Basic Syntax

Function Negate(Value)

### C++ Syntax

HRESULT Negate([in] VARIANT Value, [out, retval] VARIANT * pResult);

### Arguments

Value

Number to negate

### Return Value

Result of negation

## Round

Rounds the argument to the given number of decimal places.

### Visual Basic Syntax

Function Round(Value, iDecimals As Long)

### C++ Syntax

HRESULT Round([in] VARIANT Value, [in] int iDecimals, [out, retval] VARIANT * pResult);

### Arguments

Value

Number to round

iDecimals

Number of significant places to round to

### Return Value

Result of rounding

## Create

Creates a decimal value out of the argument.

### Visual Basic Syntax

Function Create(Value)

### C++ Syntax

HRESULT Create([in] VARIANT Value, [out, retval] VARIANT * pResult);

### Arguments

Value

String or number to create a decimal from

### Return Value

Decimal value as a variant

## EQ

Returns true if first argument is equal to second.

### Visual Basic Syntax

Function EQ(Val1, Val2) As Boolean

### C++ Syntax

HRESULT EQ([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT_BOOL * pResult);

### Arguments

Numbers to compare.

### Return Value

True if values are equal; False otherwise

## NE

Returns true if first argument is not equal to second.

### Visual Basic Syntax

Function NE(Val1, Val2) As Boolean

### C++ Syntax

HRESULT NE([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT_BOOL * pResult);

### Arguments

Numbers to compare.

### Return Value

True if values are not equal; False otherwise

## LT

Returns true if first argument is less than the second.

### Visual Basic Syntax

Function LT(Val1, Val2) As Boolean

### C++ Syntax

HRESULT LT([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT_BOOL * pResult);

### Arguments

Numbers to compare.

### Return Value

True if first argument is less than the second.

## LE

Returns true if first argument is less than or equal to the second.

### Visual Basic Syntax

Function LE(Val1, Val2) As Boolean

### C++ Syntax

HRESULT LE([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT_BOOL * pResult);

### Arguments

Numbers to compare

### Return Value

True if first argument is less than or equal to the second

## Compare

Returns a comparison of the two arguments.

### Visual Basic Syntax

Function Compare(Val1, Val2) As Long

### C++ Syntax

HRESULT Compare([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT_BOOL * pResult);

### Arguments

Numbers to compare.

### Return Value

- 0 - if first argument is less than second

- 1 - if first argument is equal than second

- 2 - if first argument is greater than second

## Fix

Returns the integer portion of the argument. If the value of the variant is negative, then the first negative integer greater than or equal to the variant is returned.

### Visual Basic Syntax

Function Fix(Value)

### C++ Syntax

HRESULT Fix([in] VARIANT Value, [out, retval] VARIANT * pResult);

### Arguments

Value

Number to take integer portion

### Return Value

Result of fix computation

## GE

Returns true if first argument is greater than or equal to the second.

### Visual Basic Syntax

Function GE(Val1, Val2) As Boolean

### C++ Syntax

HRESULT GE([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT_BOOL * pResult);

### Arguments

Numbers to compare.

### Return Value

True if first argument is greater than or equal to the second

## GT

Returns true if first argument is greater than the second.

### Visual Basic Syntax

Function GT(Val1, Val2) As Boolean

### C++ Syntax

HRESULT GT([in] VARIANT Val1, [in] VARIANT Val2, [out, retval] VARIANT_BOOL * pResult);

### Arguments

Numbers to compare

### Return Value

True if first argument is greater than the second