com.esri.arcgis.system
Interface INumericFormat

All Superinterfaces:
Serializable
All Known Implementing Classes:
AngleFormat, LatLonFormat, NumericFormat, PercentageFormat, RateFormat

public interface INumericFormat
extends Serializable

Provides access to members that format numbers.

Description

The members in the INumericFormat interface define how the ValueToString method in the associated INumberFormat interface formats numbers.

Remarks

The format produced with the NumericFormat coclass object is determined solely on the INumericFormat interface property settings. Formats produced with other objects listed under CoClasses depend on two interface's property settings. These objects inherit the INumericFormat interface in addition to their own default interface.

When To Use

Use the INumericFormat interface to format numbers with any of the objects listed under CoClasses below.

Product Availability

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

See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

Method Summary
 int getAlignmentOption()
          The alignment option applied to the ValueToString method.
 int getAlignmentWidth()
          The alignment width applied to the ValueToString method.
 int getRoundingOption()
          The rounding option applied to the ValueToString method.
 int getRoundingValue()
          The rounding value, whose meaning depends on the rounding option.
 boolean isShowPlusSign()
          Indicates if formatted numbers contain a plus sign for positive numbers.
 boolean isUseSeparator()
          Indicates if formatted numbers contain digit grouping symbols.
 boolean isZeroPad()
          Indicates if formatted numbers contain padded zeros to the right of the decimal.
 void setAlignmentOption(int option)
          The alignment option applied to the ValueToString method.
 void setAlignmentWidth(int width)
          The alignment width applied to the ValueToString method.
 void setRoundingOption(int pption)
          The rounding option applied to the ValueToString method.
 void setRoundingValue(int value)
          The rounding value, whose meaning depends on the rounding option.
 void setShowPlusSign(boolean show)
          Indicates if formatted numbers contain a plus sign for positive numbers.
 void setUseSeparator(boolean sep)
          Indicates if formatted numbers contain digit grouping symbols.
 void setZeroPad(boolean pad)
          Indicates if formatted numbers contain padded zeros to the right of the decimal.
 

Method Detail

setRoundingOption

void setRoundingOption(int pption)
                       throws IOException,
                              AutomationException
The rounding option applied to the ValueToString method.

Description

The RoundingOption property sets or returns the rounding option to be used when the ValueToString method in the associated INumberFormat interface formats numbers.

The settings for RoundingOption are:

Setting Description

esriRoundNumberOfDecimals

(Default) Numbers are rounded to the number of decimal places defined in the RoundingValue property.

If ZeroPad is also set True, decimal zeros are appended at the right up to the number of places indicated in the RoundingValue property.

esriRoundNumberOfSignificantDigits

Numbers are rounded to the number of significant digits indicated in the RoundingValue property.

To format numbers and express significant zeros at the right of the decimal, set ZeroPad True. For example, the number 12.0345 in 8 significant digits is the number 12.034500. In order to express the rightmost significant zeros, ZeroPad should be set True. With ZeroPad set False, the formatted number would be 12.0345.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
pption - A com.esri.arcgis.system.esriRoundingOptionEnum constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

getRoundingOption

int getRoundingOption()
                      throws IOException,
                             AutomationException
The rounding option applied to the ValueToString method.

Description

The RoundingOption property sets or returns the rounding option to be used when the ValueToString method in the associated INumberFormat interface formats numbers.

The settings for RoundingOption are:

Setting Description

esriRoundNumberOfDecimals

(Default) Numbers are rounded to the number of decimal places defined in the RoundingValue property.

If ZeroPad is also set True, decimal zeros are appended at the right up to the number of places indicated in the RoundingValue property.

esriRoundNumberOfSignificantDigits

Numbers are rounded to the number of significant digits indicated in the RoundingValue property.

To format numbers and express significant zeros at the right of the decimal, set ZeroPad True. For example, the number 12.0345 in 8 significant digits is the number 12.034500. In order to express the rightmost significant zeros, ZeroPad should be set True. With ZeroPad set False, the formatted number would be 12.0345.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.system.esriRoundingOptionEnum constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

setRoundingValue

void setRoundingValue(int value)
                      throws IOException,
                             AutomationException
The rounding value, whose meaning depends on the rounding option.

Description

The RoundingValue property sets or returns the number of decimal places or significant digits (default: 6) to round a number to when the ValueToString method in the associated INumberFormat interface formats numbers.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

getRoundingValue

int getRoundingValue()
                     throws IOException,
                            AutomationException
The rounding value, whose meaning depends on the rounding option.

Description

The RoundingValue property sets or returns the number of decimal places or significant digits (default: 6) to round a number to when the ValueToString method in the associated INumberFormat interface formats numbers.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The value
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

setAlignmentOption

void setAlignmentOption(int option)
                        throws IOException,
                               AutomationException
The alignment option applied to the ValueToString method.

Description

The AlignmentOption property sets or returns an option that tells the ValueToString method in the associated INumberFormat interface how to align formatted numbers

The settings for AlignmentOption are:

Setting Description

esriAlignRight

(Default) Numbers are aligned to the right. If the AlignmentWidth property is wider than the resulting formatted number, spaces are padded at the left to make the output AlignmentWidth characters wide. If the formatted number is wider than AlignmentWidth, the number is not truncated (the same as it would be if AlignmentOption were set to esriAlignLeft).

esriAlignLeft

Numbers are aligned to the left. No spaces are padded either at the left or right. If AlignmentOption is set to esriAlignLeft, the AlignmentWidth property is ignored.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
option - A com.esri.arcgis.system.esriNumericAlignmentEnum constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

getAlignmentOption

int getAlignmentOption()
                       throws IOException,
                              AutomationException
The alignment option applied to the ValueToString method.

Description

The AlignmentOption property sets or returns an option that tells the ValueToString method in the associated INumberFormat interface how to align formatted numbers. For example, the value “0.34”, formatted as a string with an AlignmentWidth of 5, is returned as “0.34” with an AlignmentOption of esriAlignRight and “0.34” with an AlignmentOption of esriAlignLeft.

The settings for AlignmentOption are:

Setting Description

esriAlignRight

(Default) Numbers are aligned to the right. If the AlignmentWidth property is wider than the resulting formatted number, spaces are padded at the left to make the output AlignmentWidth characters wide. If the formatted number is wider than AlignmentWidth, the number is not truncated (the same as it would be if AlignmentOption were set to esriAlignLeft).

esriAlignLeft

Numbers are aligned to the left. No spaces are padded either at the left or right. If AlignmentOption is set to esriAlignLeft, the AlignmentWidth property is ignored.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A com.esri.arcgis.system.esriNumericAlignmentEnum constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

setAlignmentWidth

void setAlignmentWidth(int width)
                       throws IOException,
                              AutomationException
The alignment width applied to the ValueToString method.

Description

The AlignmentWidth property sets or returns the width (default: 12) of the resulting string the ValueToString method in the associated INumberFormat interface produces.

If the AlignmentOption property is set to esriAlignRight, the formatted number will be AlignmentWidth characters wide, padding spaces to the left of the number as needed. If AlignmentOption = esriAlignLeft, the AlignmentWidth property is ignored.

Remarks

If AlignmentOption = esriAlignRight, make sure AlignmentWidth is set wide enough to handle the resulting formatted number. If it is not, the number will not be truncated, but the length of the formatted number will be longer than the AlignmentWidth.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
width - The width (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

getAlignmentWidth

int getAlignmentWidth()
                      throws IOException,
                             AutomationException
The alignment width applied to the ValueToString method.

Description

The AlignmentWidth property sets or returns the width (default: 12) of the resulting string the ValueToString method in the associated INumberFormat interface produces.

If the AlignmentOption property is set to esriAlignRight, the formatted number will be AlignmentWidth characters wide, padding spaces to the left of the number as needed. If AlignmentOption = esriAlignLeft, the AlignmentWidth property is ignored. The width includes plus signs and any decimal points. For example, +1,234.56 has a width of 9.

Remarks

If AlignmentOption = esriAlignRight, make sure AlignmentWidth is set wide enough to handle the resulting formatted number. If it is not, the number will not be truncated, but the length of the formatted number will be longer than the AlignmentWidth.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The width
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

setUseSeparator

void setUseSeparator(boolean sep)
                     throws IOException,
                            AutomationException
Indicates if formatted numbers contain digit grouping symbols.

Description

The UseSeparator property sets or returns an indicator that tells whether to include a digit grouping symbol when the ValueToString method in the associated INumberFormat interface formats numbers.

The settings for UseSeparator are:

Setting Description

False

(Default) Numbers are formatted without a digit grouping symbol, for example, 1234567.89.

True

Numbers are formatted with a digit grouping symbol, for example, 1,234,567.89.

Remarks

Numbers are formatted using the current regional settings defined for the system at runtime. To change the separator symbol or where the separator appears in the formatted number, change the settings on the Number tab of Control Panel's Regional Settings applet.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
sep - The sep (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

isUseSeparator

boolean isUseSeparator()
                       throws IOException,
                              AutomationException
Indicates if formatted numbers contain digit grouping symbols.

Description

The UseSeparator property sets or returns an indicator that tells whether to include a digit grouping symbol when the ValueToString method in the associated INumberFormat interface formats numbers.

The settings for UseSeparator are:

Setting Description

False

(Default) Numbers are formatted without a digit grouping symbol, for example, 1234567.89.

True

Numbers are formatted with a digit grouping symbol, for example, 1,234,567.89.

Remarks

Numbers are formatted using the current regional settings defined for the system at runtime. To change the separator symbol or where the separator appears in the formatted number, change the settings on the Number tab of Control Panel's Regional Settings applet.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The sep
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

setZeroPad

void setZeroPad(boolean pad)
                throws IOException,
                       AutomationException
Indicates if formatted numbers contain padded zeros to the right of the decimal.

Description

The ZeroPad property sets or returns an indicator that tells whether to pad zeros at the right of the decimal when the ValueToString method in the associated INumberFormat interface formats numbers.

The settings for ZeroPad are:

Setting Description

False

(Default) Numbers are formatted without padding decimal zeros. The last decimal digit is a non-zero digit.

True

Decimal zeros or significant digit zeros are appended at the right of the decimal point up to the number of places indicated in the RoundingValue property.

The RoundingOption setting determines whether decimal zeros or significant digit zeros are appended.

Remarks

To format numbers and express significant zeros at the right of the decimal, set ZeroPad True. For example, the number 12.0345 in 8 significant digits is the number 12.034500. In order to express the rightmost significant zeros, ZeroPad should be set True. With ZeroPad set False, the formatted number would be 12.0345.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
pad - The pad (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

isZeroPad

boolean isZeroPad()
                  throws IOException,
                         AutomationException
Indicates if formatted numbers contain padded zeros to the right of the decimal.

Description

The ZeroPad property sets or returns an indicator that tells whether to pad zeros at the right of the decimal when the ValueToString method in the associated INumberFormat interface formats numbers.

The settings for ZeroPad are:

Setting Description

False

(Default) Numbers are formatted without padding decimal zeros. The last decimal digit (to the right of the decimal point) is a non-zero digit.

True

Decimal zeros or significant digit zeros are appended at the right of the decimal point up to the number of places indicated in the RoundingValue property.

The RoundingOption setting determines whether decimal zeros or significant digit zeros are appended.

Remarks

To format numbers and express significant zeros at the right of the decimal, set ZeroPad True. For example, the number 12.0345 in 8 significant digits is the number 12.034500. In order to express the rightmost significant zeros, ZeroPad should be set True. With ZeroPad set False, the formatted number would be 12.0345.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The pad
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

setShowPlusSign

void setShowPlusSign(boolean show)
                     throws IOException,
                            AutomationException
Indicates if formatted numbers contain a plus sign for positive numbers.

Description

The ShowPlusSign property sets or returns an indicator that tells whether or not a plus sign symbol is used for positive numbers when the ValueToString method in the associated INumberFormat interface formats numbers.

The settings for ShowPlusSign are:

Setting Description

False

(Default) Positive numbers and zero values are formatted without a plus sign. Negative values are formatted with a minus (-) sign.

True

Positive numbers are formatted with a plus (+) sign. Zero values are formatted without a plus sign. Negative numbers are formatted with a minus (-) sign.

Remarks

Using ShowPlusSign can be useful in conjunction with IFormattedGridLabel, where a user might not know if the number is above or below the Equator, or east or west of the Central Meridian.

Also see the ShowDirections property in ILatLonFormat.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
show - The show (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat

isShowPlusSign

boolean isShowPlusSign()
                       throws IOException,
                              AutomationException
Indicates if formatted numbers contain a plus sign for positive numbers.

Description

The ShowPlusSign property sets or returns an indicator that tells whether or not a plus sign symbol (+) is to be prefixed to positive numbers when the ValueToString method in the associated INumberFormat interface formats numbers.

The settings for ShowPlusSign are:

Setting

Description

False

(Default) Positive numbers and zero values are formatted without a plus sign. Negative values are formatted with a minus (-) sign.

True

Positive numbers are formatted with a plus (+) sign. Zero values are formatted without a plus sign. Negative numbers are formatted with a minus (-) sign.

Remarks

Using ShowPlusSign can be useful in conjunction with IFormattedGridLabel, where a user might not know if the number is above or below the Equator, or east or west of the Central Meridian.

Also see the ShowDirections property in ILatLonFormat.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The show
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
ILatLonFormat2, CustomNumberFormat, IRateFormat, IAngleFormat, NumericFormat, LatLonFormat, CurrencyFormat, INumericFormat, IFractionFormat, RateFormat, IScientificNumberFormat, ICustomNumberFormat, ILatLonFormat, IPercentageFormat, INumberFormat, ScientificFormat, FractionFormat, PercentageFormat, AngleFormat