This document is archived and information here might be outdated.  Recommended version.


INumberFormat.StringToValue Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > System > ESRI.ArcGIS.esriSystem > Interfaces > IN > INumberFormat Interface > INumberFormat.StringToValue Method
ArcGIS Developer Help

INumberFormat.StringToValue Method

Converts a formatted string to a numeric value.

[Visual Basic .NET]
Public Function StringToValue ( _
    ByVal str As String _
) As Double
[C#]
public double StringToValue (
    string str
);
[C++]
HRESULT StringToValue(
  BSTR str
);
[C++]
Parameters
str [in]

str is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The StringToValue method obtains a numerical value from a formatted string. The string doesn't necessarily need to have been formatted with the ValueToString method, but the string needs to look like it would be if it was formatted with the associated interface's implementation of the ValueToString method. See the particular number formatting interface you're interested in under See Also above for more information.

Remarks

When using the StringToValue method to obtain a ValueToString argument value, the properties in the associated interface must be set the same as they were when the ValueToString method was used. This applies in cases where ValueToString may perform a numerical conversion (in the IAngleFormat, IFractionFormat, IPercentageFormat, and IRateFormat interfaces).

See Also

INumberFormat Interface | CurrencyFormat Class | IScientificNumberFormat Interface | FractionFormat Class | IPercentageFormat Interface | INumericFormat Interface | IFractionFormat Interface | NumericFormat Class | IAngleFormat Interface | LatLonFormat Class | ICustomNumberFormat Interface | PercentageFormat Class | ILatLonFormat2 Interface | ILatLonFormat Interface | RateFormat Class | IRateFormat Interface | CustomNumberFormat Class | INumberFormat Interface | ScientificFormat Class | AngleFormat Class