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


INumberFormatDialog Interface (ArcObjects .NET 10.4 SDK)
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

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