Formatting Numeric Values
Some portlets and indicators provide the Value Format property to allow you to customize the format of numeric values. Edit Portlet and Edit Indicator dialog boxes that contain the Value Format property provide a list containing common formatting options using the value 12345.67.
List Option | Description |
---|---|
12346 | Rounds up or down to a whole number. |
12345.67 | Rounds up or down to the hundredths place. |
12,346 | Rounds up or down to a whole number and inserts the American thousands separator (comma). |
12,345.67 | Rounds up or down to the hundredths place and inserts the American thousands separator (comma). |
12.3k | Abbreviates the number to the thousands with one decimal place and includes a k to indicate thousand. |
0.01m | Abbreviates the number to the millions and includes an m to designate million. |
0.00001b | Abbreviates the number to the billions and includes a b to indicate billion. |
$12,345.67 | Formats the value in US dollars. |
NOTE: Some option dialog boxes do not include the drop-down list for format options. But you can enter the format as follows.
To... | Enter |
---|---|
Round the value up or down to a whole number. | 0 |
Round the value up or down to the hundredths place. | 0.00 |
Rounds up or down to a whole number and inserts the American thousands separator (comma). | #,### |
Rounds up or down to the hundredths place and inserts the American thousands separator (comma). | #,##0,.00 |
Abbreviates the number to the thousands with one decimal place and includes a k to indicate thousand. | #,##0,.0k |
Abbreviates the number to the millions and includes an m to designate million. | #,##0,,.m |
Abbreviates the number to the billions and includes a b to indicate billion. | #,##0,,,.b |
Formats the value in US dollars. | $#,##0.00 |
Custom Number Formats
Formatting is not limited to the options in the list. You can enter a customized format in the Value Format box using the following guidelines:
- 0 is a placeholder for a digit that always appears. If the format is 0.00 and the value is .3, 0.30 displays.
- # is a placeholder for a digit that only appears if the value has a digit in that position. If the format is ##.## and the value is 3.3, 3.3 displays.
- , is the digit group separator in the US, and the decimal separator in most other locations.
- . is the decimal separator in the US.
pattern = [prefix] [number] [suffix]
The prefix and suffix are characters that appear before and after the number, but do not affect how it is displayed.
You can add a format for negative numbers; separate the two formats with a semicolon:
format = pattern;negative pattern
For example, set the negative version of a whole number with thousands separate using the following: #,##0;(#,##0)
If you expect 0 as a value, you can create a triple value format:
format = positive pattern;negative pattern;pattern
For example, +0.00;-0.00;0.00, produces positive values with a leading plus sign, negative values with a leading minus sign, and 0.00 when the value is 0.