Summary

Tag name: <dvt:numberFormat>

Use the numberFormat tag to specify formatting for numeric values.

Relationship with other tags

The numberFormat tag can be a child of any of the following graph tags:

  • sliceLabel
  • stockVolumeFormat
  • x1Axis
  • x1Format
  • y1Axis
  • y1Format
  • y2Axis
  • y2Format
  • zFormat

The numberFormat tag can be a child of any of the following gauge tags:

  • metricLabel
  • tickLabel

The numberFormat tag can have the following child tag: af:convertNumber.

Example

The following example shows XML for a numberFormat tag that is used to format numbers on a graph's Y1-Axis. The af:convertNumber tag specifies that the numbers should be treated as currency and should use the dollar sign symbol.

<dvt:graph> <dvt:y1Axis lineWidth="1"
                 lineColor="#00000" scaledLogarithmic="false"
                 logarithmicBase="10.0" axisMinAutoScaled="true"
                 axisMinValue="0.0" axisMaxAutoScaled="true" axisMaxValue="60.0"
                 majorTickStepAutomatic="true" majorTickStep="10.0">
                 <dvt:numberFormat> <af:convertNumber type="currency"
                 currencySymbol="$"/> </dvt:numberFormat>
                 </dvt:y1Axis> </dvt:graph>

The following example shows XML for a number format tag that is used to format marker text for the graph's Y1-Axis. Numbers should be followed by a sign.

   <dvt:graph> 
      <dvt:markerText visible="true" markerTextPlace="MTP_OUTSIDE_MAX"> 
         <dvt:graphFont name="SansSerif" size="10" color="#000000" bold="true" italic="false" underline="false"/> 
         <dvt:y1Format> 
            <dvt:numberFormat posNumFmt="POS_NUMFMT_NUM_POS"/>
         </dvt:y1Format> 
      </dvt:markerText> 
   </dvt:graph>
   

Attributes

Name Type Supports EL? Description
id java.lang.String no Specifies the identifier for the component
numberType java.lang.String yes Specifies the kind of number to be formatted. Valid values are:
  • NUMTYPE_GENERAL - (Default) specifies the value as a numerical value.
  • NUMTYPE_CURRENCY - specifies the value as a currency.
  • NUMTYPE_PERCENT - specifies the value as a percentage.
thousandSeparator char yes Specifies the symbol to be used as the thousands separator. Any character is allowed.

Example: If a thousandSeparator is specified to be ",", then the value "1000" will be displayed as "1,000".

decimalSeparator char yes Specifies the symbol to be used as the decimal separator. Any character is allowed.

Example: If a decimalSeparator is specified to be ".", then the value "1000" will be displayed as "1000.00". (Assume two decimal places are specified)

currencySymbol java.lang.String yes Specifies the symbol to be used as the currency symbol. Any character is allowed.

Example: If a currencySymbol is specified to be "$", then the value "1000" will be displayed as "$1000".

leadingZero boolean yes Indicates whether numbers that fall between 1.0 and -1.0 are displayed with leading zeros. Valid values are "true" (Default) and "false".
decimalDigit int yes Specifies the number of decimal digits to display.
posNumFmt java.lang.String yes Specifies the format for positive numbers. Valid values are:
  • POS_NUMFMT_BY_LOCALE - (Default) Uses locale formatting.
  • POS_NUMFMT_NUM - Displays number without a sign.
  • POS_NUMFMT_NUM_POS - Displays the number followed by a sign.
  • POS_NUMFMT_POS_NUM - Displays a sign followed by the number.
negNumFmt java.lang.String yes Specifies the format for negative numbers. Valid values are:
  • NEG_NUMFMT_BY_LOCALE - (Default) Uses locale formatting.
  • NEG_NUMFMT_NEG_NUM - Displays number without a sign.
  • NEG_NUMFMT_NUM_NEG - Displays the number followed by a sign.
  • NEG_NUMFMT_OP_NUM_CP - Displays in the format (1)
posCurFmt java.lang.String yes Specifies the format for positive currency. Valid values are:
  • POS_CURFMT_BY_LOCALE - (Default) Uses locale formatting.
  • POS_CURFMT_CUR_NUM - Displays the currency symbol followed by the number.
  • POS_CURFMT_CUR_NUM_POS - Displays the number followed by a sign.
  • POS_CURFMT_CUR_SPAC_NUM - Displays the currency symbol, a space, and the number.
  • POS_CURFMT_NUM_CUR - Displays the number followed by a currency symbol.
  • POS_CURFMT_NUM_CUR_POS - Displays the number, a currency symbol, and a sign.
  • POS_CURFMT_NUM_POS_CUR - Displays the number, a sign, and the currency symbol.
  • POS_CURFMT_NUM_SPAC_CUR - Displays the number, a space, and the currency symbol.
  • POS_CURFMT_NUM_SPAC_CUR_POS - Displays the number, a space, the currency symbol, and a sign.
  • POS_CURFMT_POS_CUR_NUM - Displays the currency symbol followed by the number.
  • POS_CURFMT_POS_CUR_SPAC_NUM - Displays the currency symbol, a space, and the number.
  • POS_CURFMT_POS_NUM_CUR - Displays the sign, the number, and a currency symbol.
  • POS_CURFMT_POS_NUM_SPAC_CUR - Displays the number, a space, and the currency symbol.
negCurFmt java.lang.String yes Specifies the format for negative currency values. Valid values are:
  • NEG_CURFMT_BY_LOCALE - (Default) Uses locale formatting.
  • NEG_CURFMT_CUR_NEG_NUM - Displays the currency symbol followed by the number.
  • NEG_CURFMT_CUR_NUM_NEG - Displays the currency symbol, the number, and a sign.
  • NEG_CURFMT_NEG_CUR_NUM - Displays a sign, the currency symbol, and the number.
  • NEG_CURFMT_NEG_NUM_CUR - Displays the number followed by a currency symbol.
  • NEG_CURFMT_NUM_CUR_NEG - Displays the number, a currency symbol, and a sign.
  • NEG_CURFMT_NUM_NEG_CUR - Displays the number, a sign, and the currency symbol.
  • NEG_CURFMT_OP_CUR_NUM_CP - Displays in the format ($1)
  • NEG_CURFMT_OP_NUM_CUR_CP - Displays in the format (1$)
  • NEG_CURFMT_NEG_CUR_SPAC_NUM - Displays the currency symbol, a space, and the number.
  • NEG_CURFMT_NEG_NUM_SPAC_CUR - Displays the number, a space, and the currency symbol.
  • NEG_CURFMT_NUM_SPAC_CUR_NEG - Displays the number, a space, the currency symbol, and a sign.
scaleFactor java.lang.String yes Specifies how much to abbreviate a number. For example, if you set ScaleFactor to SCALEFACTOR_THOUSANDS, the view displays the number as thousands, and a number such as 153,000 appears as 153K (assuming the default value of the ScaleDownThousands property and the locale is English). The number will be auto-scaled by default depending on its value.

Valid values are:

  • SCALEFACTOR_NONE - Performs no scaling.
  • SCALEFACTOR_THOUSANDS - Scales by thousands.
  • SCALEFACTOR_MILLIONS - Scales by millions.
  • SCALEFACTOR_BILLIONS - Scales by billions.
  • SCALEFACTOR_TRILLIONS - Scales by trillions.
  • SCALEFACTOR_QUADRILLIONS - Scales by quadrillions.
scaleDownThousands java.lang.String yes Specifies the character or string that represents the abbreviation for thousands.
scaleDownMillions java.lang.String yes Specifies the character or string that represents the abbreviation for millions.
scaleDownBillions java.lang.String yes Specifies the character or string that represents the abbreviation for billions.
scaleDownTrillions java.lang.String yes Specifies the character or string that represents the abbreviation for trillions.
scaleDownQuadrillions java.lang.String yes Specifies the character or string that represents the abbreviation for quadrillions.
numberFormatString java.lang.String yes Specifies the Oracle format string.
Symbol Usage Example Result
9 Number Includes a leading negative sign for negative numbers or one leading space for positive numbers 9999 1234
D Position of the decimal point 99D99 12.34
0 Leading or trailing zeroes for decimal numbers D999, 0D99900 .123, 0.12300
FM Suppress all leading / trailing blanks FM9999 123
$ Include a leading $ $999 $123
B Over-ride the 0 format and replace leading 0s with blank spaces B9999 123
S Include both positive + and negative - signs S999, 999S +123, 123+
MI Indicate Minus SIGN 999MI 123-
G Group separator (often a comma) in desired position 9G999 1,234
, Return a comma in desired position 9,999 1,234
. Return a period in desired position 99.99 12.34
C ISO currency symbol C999 USD123, JPY123, EUR123 (Locale dependent)
L Local currency symbol L999 $123, ¥123, £123 (Locale dependent)
K Space between number and currency symbol LK99 $ 123