Specifying formatting for numbers and dates
You can configure grid columns, chart labels, and parameters to display numbers and dates using common formats. To apply number and date formatting, you can choose from predefined options or type format codes. Values derived from format codes are always displayed in your local format, which is determined from your browser settings.
Data types that support local formatting
Fields that contain the following data types support local formatting:
- float
- integer
- datetime
Apply number and date formatting to a field or label
- Access the properties for a field or label configured to display the float, integer, or datetime data types.
- In the Value Formatting dialog box, choose one of the following:
- General — type a format code.
- Number — specify a number format. Adjust any of the following properties:
- Decimal Places — specify the number of decimal places.
- Rounding Method — choose from the following:
- Round
- Ceiling
- Floor
- Truncate
- Use 1000 Separator — display the 1000 separator.
- Trim Trailing Zeros — remove zeros from the decimal representation of the number, after which no other digits follow.
- K/M/B Summarization — select to display how large numbers are displayed. Choose from the following formats for summarization:
- 1000000
- 1M
- 1 million
- Currency — specify a currency format.
Adjust any of the following properties:
- Currency Code — specify the currency code for your locale.
- Symbol Form — choose from the following:
- $
- $ or the preferred alternative for the locale
- USD
- US Dollar
- Decimal Places — specify the number of decimal places.
- Rounding Method — choose from the following:
- Round
- Ceiling
- Floor
- Truncate
- Use 1000 Separator — display the 1000 separator.
- Trim Trailing Zeros — remove zeros from the decimal representation of the number, after which no other digits follow.
- K/M/B Summarization — select to display how large numbers are displayed. Choose from the following formats for summarization:
- 1000000
- 1M
- 1 million
- Accounting — specify an accounting format.
Adjust any of the following properties:
- Currency Code — specify the currency code for your locale.
- Symbol Form — choose from the following:
- $
- $ or the preferred alternative for the locale
- USD
- US Dollar
- Decimal Places — specify the number of decimal places.
- Rounding Method — choose from the following:
- Round
- Ceiling
- Floor
- Truncate
- Use 1000 Separator — display the 1000 separator.
- Date and Time — specify a date and time format.
Select a format.
- Percentage — specify a percentage format. Adjust any of the following properties:
- Decimal Places — specify the number of decimal places.
- Rounding Method — choose from the following:
- Round
- Ceiling
- Floor
- Truncate
- Use 1000 Separator — display the 1000 separator.
- Trim Trailing Zeros — remove zeros from the decimal representation of the number, after which no other digits follow.
- K/M/B Summarization — select to display how large numbers are displayed. Choose from the following formats for summarization:
- 1000000
- 1M
- 1 million
- Custom — type a format code.
- Click OK.
- Click Save.
Use number and date format codes
- Access the properties for a field or label configured to display the date and time data type.
- In the Display Format box, type combinations of any of the following:
- d — display dates using a short date format. For example, 3/1/15.
- M — display dates using month numbers. For example, 3 (for March).
- y — display dates using four digit year numbers. For example, 2018.
- C — display numbers as currency. For example, $200.
- N — display numbers with standard formatting, separators, and two decimal places. For example, 121,800.00.
- P — display numbers as percentages (the number multiplied by 100 and displayed with a percent symbol). For example, 383.00%.
- These strings are case sensitive. If you specify a string using an incorrect case, the value won't display correctly.
- Add a number to a string to define precision. For example, "C4" produces a currency value with four decimal places.
- Use one of the standard date format strings to apply common formats quickly.
Standard date format strings
Use this string | To format date values like this |
dd-MM-yyyy (HH:mm:ss) | 03-08-2017 (17:54:55) |
yyyy-MM-dd | 2017-08-03 |
yyyy-MM-dd HH:mm:ss | 2017-08-03 17:54:55 |
yyyy-MM-dd HH:mm:ss.SSS | 2017-08-03 17:54:55.051 |
dd MMMM yyyy | 03 August 2017 |
dd MMMM yyyy HH:mm:ss | 03 August 2017 17:54:55 |
dd MMMM yyyy hh:mm:ss | 03 August 2017 05:54:55 |
dd MMM yyyy | 03 Aug 2017 |
dd MMM yyyy HH:mm:ss | 03 Aug 2017 17:54:55 |
dd MMM yyyy hh:mm:ss | 03 Aug 2017 05:54:55 |
Specifying number and date formats for parameter values
Parameters in widget text boxes
All widget text boxes that support parameters also allow you to assign formatting using format codes. Parameters with custom formatting have the following syntax:
{@parameter:format code}
{@label1:n2}
Parameters without an assigned format use a default format according to the data type:
- datetime = d (short date)
- integer = N0 (standard formatting with no decimal places)
- float = N2 (standard formatting with two decimal places)
Parameters in the Statement Editor
Parameters displayed using the Statement Editor (column statements in the Grid widget), access the column properties to specify number and date formatting using the Display Format options.
Last modified: Tuesday July 30, 2024