ArcObjects Library Reference (Framework)  

INumberFormatDialog Interface

Provides access to members that work with the number format dialog.

Product Availability

Available with ArcGIS Desktop.

Members

Description
Method DoModal Displays the number format dialog.
Read/write property NumberFormat The current number format object.

CoClasses that implement INumberFormatDialog

CoClasses and Classes Description
NumberFormatDialog Number Format Dialog object.

Remarks

This example demonstrates how to use NumberFormatDialog. You would get m_app from the hook in ICommand::OnCreate().

[C#]
//Setup the NumericFormat
INumericFormat numericFormat = new NumericFormatClass();
numericFormat.RoundingOption = esriRoundingOptionEnum.esriRoundNumberOfDecimals;
numericFormat.RoundingValue = 3;
numericFormat.ShowPlusSign = true;
numericFormat.UseSeparator = true;
//Set the NUmberFormatDialog's NumberFormat property
INumberFormatDialog numFormatDlg = new NumberFormatDialogClass();
numFormatDlg.NumberFormat = numericFormat as INumberFormat;
// Open the dialog on the application's window
if (numFormatDlg.DoModal(m_app.hWnd))
{
  INumberFormat numFormat = numFormatDlg.NumberFormat;
  System.Windows.Forms.MessageBox.Show(numFormat.ValueToString(12345.6789));
}
[Visual Basic .NET]
'Setup the NumericFormat
Dim numericFormat As INumericFormat = New NumericFormatClass()
numericFormat.RoundingOption = esriRoundingOptionEnum.esriRoundNumberOfDecimals
numericFormat.RoundingValue = 3
numericFormat.ShowPlusSign = True
numericFormat.UseSeparator = True
'Set the NUmberFormatDialog's NumberFormat property
Dim numFormatDlg As INumberFormatDialog = New NumberFormatDialogClass()
numFormatDlg.NumberFormat = TryCast(numericFormat, INumberFormat)
' Open the dialog on the application's window
If numFormatDlg.DoModal(m_app.hWnd) Then
 Dim numFormat As INumberFormat = numFormatDlg.NumberFormat
 System.Windows.Forms.MessageBox.Show(numFormat.ValueToString(12345.6789))
End If

 

See Also

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