MoneyToInteger (open)

Converts a MONEY value to an INTEGER value.

Syntax

LOADLIB "wh::money.whlib";

INTEGER FUNCTION MoneyToInteger(MONEY value)

Parameters

MONEY value

The MONEY value to be converted

Return value

INTEGER

The INTEGER value of @italic value

Description

This function can be used to convert a MONEY to a INTEGER value. Make sure that the MONEY value is within the INTEGER range to avoid an overflow. Decimals in a MONEY value will be truncated during the conversion.

Examples

// The INTEGER value will be 17
INTEGER i := MoneyToInteger(17.0);

// The INTEGER value will be 17. As an INTEGER has no decimals, the
// decimals in the MONEY value are lost.
INTEGER i := MoneyToInteger(17.58765);

// The INTEGER value will be -2147483648. As the MONEY value is
// outside the INTEGER range, the INTEGER value flows over.
INTEGER i := MoneyToInteger(2147483648.);