IDataFunctions::ValidateFloat

The ValidateFloat method verifies that the specified double falls within the provided range.

Syntax

HRESULT ValidateFloat(
VARIANT vtNumber,// in
VARIANT vtMin,// in
VARIANT vtMax,// in
BOOL* pfValid// out
);

Parameters

vtNumber
A VARIANT that contains the number on which to perform range-checking. This VARIANT’s vt member can be initialized to the following types: VT_I2, VT_I4, VT_R4, VT_R8, VT_CY, VT_I1, VT_UI1, VT_UI2, VT_UI4, VT_I8, VT_INT, VT_UINT. However, prior to performing validation on this number, ValidateFloat converts it to a VARIANT (VT_R8).
vtMin
A VARIANT that specifies the minimum end of the range. Prior to performing the range validation, ValidateFloat converts this VARIANT to a long VARIANT (VT_R8).
vtMax
A VARIANT that specifies the maximum end of the range. Prior to performing the range validation, ValidateFloat converts this VARIANT to a long VARIANT (VT_R8).
pfValid
If ValidateFloat is successful, this out-value points to a VARIANT_BOOL VARIANT, the boolVal member of which indicates whether the vtNumber falls within the range specified by vtMin and vtMax; otherwise, pfValid is set to NULL.

Include

<commerce.h>

Return Value

Value Description
S_OK This function always returns S_OK. To determine whether or not the operation was actually successful, check the pfValid out-value.

Related Topic

IDataFunctions::ConvertFloatString, IDataFunctions::Float


© 1997-1998 Microsoft Corporation. All rights reserved.