Report Field Formats

Follow

This document describes the options for formatting Report Fields.  Contents can be used to format:

  • Dimensions
  • Aggregate Measures
  • Detail Report Fields

Standard Formats

The following standard formats are available to use in formatting a report field.

Type

Description

<

Converts all characters to lower-case.

>

Converts all characters to upper-case.

General Date

Display a date and/or time. For real numbers, display a date and time, for example, 4/3/93 05:34 PM. If there is no fractional part, display only a date, for example, 4/3/93. If there is no integer part, display time only, for example, 05:34 PM. Date display is determined by the web server's settings.

Long Date

Display a date according to the web server's Long Date format.

Medium Date

Display a date using the Medium Date format appropriate for the locale.

Short Date

Display a date using Short Date format.

Long Time

Display time using the Long Time format; includes hours, minutes, seconds.

Medium Time

Display time in 12-hour format using hours and minutes and the AM/PM designator.

Short Time

Display time using the 24-hour format, for example, 17:45.

yyyy/MM/dd

A custom date/time format defined by the implementer using the components described in the next section.

hh:mm

Display time as hours and minutes, with leading zeroes. Example: 01:08

yyyy/MM/dd hh:mm:ss

Display date and time, with leading zeroes. Example: 2007/01/01 01:08:02

General Number

Display number with no thousands separator.

Currency

Display number with thousands separator, if appropriate, and with two digits to the right of the decimal separator. Output is based your system locale settings.

Fixed

Display at least one digit to the left and two digits to the right of the decimal separator.

Standard

Display number with thousands separator, at least one digit to the left and two digits to the right of the decimal separator.

Percent

Display number multiplied by 100 with a percent sign (%) appended to the right, and with two digits to the right of the decimal separator.

Scientific

Use standard scientific notation.

mp

Formats numbers by applying the appropriate "metric prefixes" (giga-, mega-, kilo-, etc.) . Example: "1,234,567" formatted with "$#.00mp" produces "$1.23M". More information about metric prefixes can be found here

mps3

Identical to the mp format, but allows rounding to three significant digits. Example: A value of 123456, with format mps3, returns 123K.

###,###,##0.00

Display number with thousands separator for every three digits to left, at least one digit to the left and two digits to the right of the decimal separator.

Yes/No

Display No if number is 0; otherwise, display Yes.

True/False

Display False if number is 0; otherwise, display True.

On/Off

Display Off if number is 0; otherwise, display On.

Expanded Spaces

Preserves space characters that are normally collapsed by the web browser. This formatting only applies to a subset of reports and panels.

Preserve Line Feeds

Preserves line breaks (CTRL-ENTER). This formatting only applies to a subset of reports and panels.

 

Custom Date and Time Formats

In addition to the standard formats listed above, implementers can may use custom date and time formats .

For example, one of the standard date formats is "yyyy/MM/dd".  Implementers can directly enter other combinations of valid formatting characters, such as "MM/dd/yyyy" to obtain the desired format. Note that format values are case-sensitive and are not entered with quotation marks. Here are the valid date and time formatting characters:

Chars

Description

:

Time separator. In some locales, other characters may be used to represent the time separator. The time separator separates hours, minutes, and seconds when time values are formatted. The actual character used as the time separator in formatted output is determined by the client OS locale setting.

/

Date separator. In some locales, other characters may be used to represent the date separator. The date separator separates the day, month, and year when date values are formatted. The actual character used as the date separator in formatted output is determined by the client OS locale setting.

%

Used to indicate that the following character should be read as a single-letter format without regard to any trailing letters. Also used to indicate that a single-letter format is read as a user-defined format. See below for further details.

d

Day as a number, without a leading zero: 1. Use %d if this is the only character in your user-defined numeric format.

dd

Day of month number, with leading zero: 04

ddd

Three-letter abbreviation of day name: Wed

dddd

Full day name: Thursday

M

Full month name and day combination: July 22

MM

Month number: 07

MMM

Three-letter month name abbreviation: Jul

MMMM

Full month name: September

y

Year number (0-9), without leading zeros. Use %y if this is the only character in your user-defined numeric format.

yy

Two-digit year, with a leading zero, but without century: 09

yyyy

Four-digit year: 2009

h

Hour as a number, without a leading zero, using the 12-hour clock: 1:15:15 PM. Use %h if this is the only character in your user-defined numeric format.

hh

Hour as a number, with a leading zero, using the 12-hour clock: 04

H

Hour as a number, without a leading zero, using the 24-hour clock: 13:15:15 PM. Use %H if this is the only character in your user-defined numeric format.

HH

Hour as a number, with a leading zero, using the 24-hour clock: 01

m

Minute as a number, without leading zeros: 12:1:15. Use %m if this is the only character in your user-defined numeric format.

mm

Minute as a number, with leading zeros: 12:01:15

s

Second as a number, without leading zeros: 12:1:5. Use %m if this is the only character in your user-defined numeric format.

ss

Second as a number, with a leading zero: 12:1:05

T

Uses the 12-hour clock and displays an uppercase A for any hour before noon; displays an uppercase P for any hour between noon and 11:59 P.M.

t

Hour and minute with AM/PM designator: 10:32 AM

tt

AM or PM designator alone: PM

z

Timezone offset as a number, without a leading zero: -8. Use %z if this is the only character in your user-defined numeric format.

zz

Timezone offset as a number, with a leading zero: -08

zzz

Full timezone offset as a number, with a leading zero: -08:00

 

  Back to the top

 

Custom Numeric Formats

In addition to the standard formats listed above, implementers can define custom numeric formats.

For example, one of the standard date formats is "###,###,##0.00". Implementers can enter other combinations of valid formatting characters, such as "$#,##0" to obtain the desired format. Here are the valid numeric formatting characters:

Chars

Description

None

Explicitly displays the number with no formatting (including standard ENGAGEcx formatting)

0

Digit placeholder. Displays a digit or a zero. If the expression has a digit in the position where the zero appears in the format string, display it; otherwise, displays a zero in that position.

If the number has fewer digits than there are zeros (on either side of the decimal) in the format expression, displays leading or trailing zeros. If the number has more digits to the right of the decimal separator than there are zeros to the right of the decimal separator in the format expression, rounds the number to as many decimal places as there are zeros. If the number has more digits to the left of the decimal separator than there are zeros to the left of the decimal separator in the format expression, displays the extra digits without modification.

#

Digit placeholder. Displays a digit or nothing. If the expression has a digit in the position where the # character appears in the format string, displays it; otherwise, displays nothing in that position.

This symbol works like the 0 digit placeholder, except that leading and trailing zeros aren't displayed if the number has fewer digits than there are # characters on either side of the decimal separator in the format expression.

.

Decimal placeholder. The decimal placeholder determines how many digits are displayed to the left and right of the decimal separator. If the format expression contains only # characters to the left of this symbol; numbers smaller than 1 begin with a decimal separator. To display a leading zero displayed with fractional numbers, use zero as the first digit placeholder to the left of the decimal separator. In some locales, a comma is used as the decimal separator. The actual character used as a decimal placeholder in the formatted output depends on the number format recognized by your system. Thus, you should use the period as the decimal placeholder in your formats even if you are in a locale that uses a comma as a decimal placeholder. The formatted string will appear in the format correct for the locale.

%

Percent placeholder. Multiplies the expression by 100. The percent character (%) is inserted in the position where it appears in the format string.

,

Thousand separator. The thousand separator separates thousands from hundreds within a number that has four or more places to the left of the decimal separator. Standard use of the thousand separator is specified if the format contains a thousand separator surrounded by digit placeholders (0 or #). A thousand separator immediately to the left of the decimal separator (whether or not a decimal is specified) or as the rightmost character in the string means "scale the number by dividing it by 1,000, rounding as needed."

For example, you can use the format string "##0,." to represent 100 million as 100,000. Numbers smaller than 1,000 but greater or equal to 500 are displayed as 1, and numbers smaller than 500 are displayed as 0. Two adjacent thousand separators in this position scale by a factor of 1 million, and an additional factor of 1,000 for each additional separator.

Multiple separators in any position other than immediately to the left of the decimal separator or the rightmost position in the string are treated simply as specifying the use of a thousand separator. In some locales, a period is used as a thousand separator. The actual character used as the thousand separator in the formatted output depends on the Number Format recognized by your system. Thus, you should use the comma as the thousand separator in your formats even if you are in a locale that uses a period as a thousand separator. The formatted string will appear in the format correct for the locale.

E- E+ e- e+

Scientific format. If the format expression contains at least one digit placeholder (0 or #) to the left of E-, E+, e-, or e+, the number is displayed in scientific format and E or e is inserted between the number and its exponent. The number of digit placeholders to the left determines the number of digits in the exponent. Use E- or e- to place a minus sign next to negative exponents. Use E+ or e+ to place a minus sign next to negative exponents and a plus sign next to positive exponents. You must also include digit placeholders to the right of this symbol to get correct formatting.

- + $ ( )

Literal characters. These characters are displayed exactly as typed in the format string. To display a character other than one of those listed, precede it with a backslash (\) or enclose it in double quotation marks (" ").

\

Displays the next character in the format string. To display a character that has special meaning as a literal character, precede it with a backslash (\). The backslash itself isn't displayed. Using a backslash is the same as enclosing the next character in double quotation marks. To display a backslash, use two backslashes (\\).

Examples of characters that can't be displayed as literal characters are the date-formatting and time-formatting characters (a, c, d, h, m, n, p, q, s, t, w, y, /, and :), the numeric-formatting characters (#, 0, %, E, e, comma, and period), and the string-formatting characters (@, &, <, >, and !).

 

Have more questions? Submit a request

Comments

Powered by Zendesk