VariantRound
(DecimalRound, CurrencyRound)
f90VB Modules
f90VBDefs, f90VBVariants
Summary
Returns the passed variant rounded to the indicated number of decimal places.
Syntax
| type(VARIANT) function VariantRound | (VarValue, DecimalPlaces, iRet) |
| type(VARIANT),intent(in):: | VarValue |
| integer(LONG_KIND),intent(in):: | DecimalPlaces |
| integer(HRESULT_KIND),intent(out),optional:: | iRet |
Arguments
VarValue [Input]
A variant value. Must be initialized variants.
DecimalPlaces [Input]
The number of decimal places for the rounded variant.
iRet [Output/Optional]
Upon return, iRet contains S_OK or an error code. See comments for more information.
Comments
Functions DecimalRound and CurrencyRound work exactly the same as VariantRound, but the arguments and the return value are of type DECIMAL and CURRENCY respectively.
Argument iRet
Indicates success or failure of the subroutine. The following codes can be returned in this argument:
| Value returned in argument iRet | Description | |
| S_OK | Success. | |
| DISP_E_BADVARTYPE | One or both of the passed variant types are not a valid type of variant. | |
| DISP_E_TYPEMISMATCH | At least one of the variants could not be coerced to the appropriate type for this operation. | |
| E_INVALIDARG | One of the arguments is invalid. | |
| E_OUTOFMEMORY | Memory could not be allocated for the operation.. | |
Related Topics
| For information about: | See: | |
| Variant integer truncation | VariantInt | |