Spread 8.0 Documentation
GetFloat, ScriptGetFloat Methods
Support Options
ActiveX Reference > ActiveX Methods > GetFloat, ScriptGetFloat Methods

Glossary Item Box

GetFloat, ScriptGetFloat Methods


See Also    DLL

Applies To

fpSpread control

Description

Returns the value in a currency, number, or percent cell as a floating-point value.

Syntax

C++

BOOL CSpreadSheet::GetFloat(long Col, long Row, double* Value);

Visual Basic

fpSpread.GetFloat(ByVal Col As Long, ByVal Row As Long, Value As Double) As Boolean

Note: The ScriptGetFloat method uses the same syntax except method parameters that are not passed "ByVal" are declared as variants. For more information on Script methods, see Scripting Environment Usage.

Parameters

The following parameters are available:

Parameter Description
Col Column number of cell
Row Row number of cell
Value Returns the floating-point value

Remarks

Use the GetFloat method to return the value of a currency, number, or percent cell as a numeric value. The Clip, ClipValue, Text, and Value properties return the value in a cell as a string. For more information about using these properties and methods, see Returning Data.

This method is called for the current sheet setting unless you first set the Sheet property to specify the sheet with which you want to work.

The GetFloat method returns the floating-point value of a cell if the cell type is currency, number, or percent. For percent cells, the value is stored as the decimal equivalent of the percent value. The cell displays the decimal value multiplied by 100. The GetFloat method returns the decimal equivalent. For example, if the cell displays "7%", the method returns the value 0.07.

Note: Call this method if you use the Spread control in a scripting environment (for example, Microsoft's Visual InterDev or Internet Explorer) or a non-scripting environment. However, if you want to use the Spread control in a scripting environment and you want to change any parameter that is not passed "ByVal", you must set the ScriptEnhanced property to True and call the ScriptGetFloat method. ScriptGetFloat method parameters that are not passed "ByVal" are declared as variants.

If you set the Col or Row parameter to –1 to return data from multiple cells, unless the cells were set with the Col or Row parameter set to –1, the method does not return a value.

Return Type

True if the floating-point value is returned in the Value parameter. If the floating-point value cannot be returned, the method returns False.

See Also

Returning Data

Clip, ClipValue, ScriptEnhanced, Sheet, Text, Value properties

GetText, SetFloat methods

DLL Correspondence

SSGetFloat function

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.