Text Formats¶
There are numerous formats for presenting dates, numbers, currencies, and text, each tailored to specific functional requirements.
| Format | Description | Unformatted Value | Formatted Value |
|---|---|---|---|
| Number formats | |||
n;2 |
Two decimals | 1537.2598 | 1,537.26 |
n;0 |
No decimals | 1537.2598 | 1,537 |
n;6 |
High precision (6 digits) | 1537.2598 | 1,537.259800 |
n;2;6 |
Flex precision (min 2, max 6 decimals) | 1537.2598 | 1,537.2598 |
number;0;2;c |
Compact Number | 1537.2598 | 1.54K |
n;2;2;a |
Accounting (negatives in parentheses) | -1537.2598 | (1,537.26) |
n;2;2;z|- |
Zero as dash | 0 | - |
zeropad;2 |
Zero pad (2 digits) | 5 | 05 |
| Percent formats | |||
p;2 |
Default | 0.994587 | 99.46% |
ps;2 |
Add percent sign | 0.994587 | 0.99% |
percentnosign;2 |
Hide percent sign | 0.994587 | 99.46 |
p;0 |
No decimals | 0.994587 | 99% |
p;1 |
One decimal | 0.994587 | 99.5% |
p;1;1;a |
Accounting (negatives in parentheses) | -0.052 | (5.2%) |
p;1;1;z|- |
Zero as dash | 0 | - |
| Date formats | |||
d |
Default date | 2024-04-18T22:46:27 | 04/18/2024 |
dt |
Default date and time | 2024-04-18T22:46:27 | 4/18/2024, 10:46 PM |
dt;MMMyy |
Month name and Year | 2024-04-18T22:46:27 | Apr 24 |
dt;MMyy |
Month number and Year | 2024-04-18T22:46:27 | 04/24 |
dt;MMMMyyyy |
Long Month name and Year | 2024-04-18T22:46:27 | April 2024 |
dt;yyyyMMddHHmm |
Full date time, numeric month | 2024-04-18T22:46:27 | 04/18/2024, 10:46 PM |
dt;yyyyMMMddhhmm |
Full date time, month name | 2024-04-18T22:46:27 | Apr 18, 2024, 10:46 PM |
quarter |
Year Quarter | 2024-04-18 | Q2 2024 |
quarter;;exclusive |
Year Quarter, period end (day before) | 2024-04-01 | Q1 2024 |
quarter;{yy}Q{q} |
Short Year Quarter | 2024-04-18 | 24Q2 |
quarter;{yy}Q{q};exclusive |
Short Year Quarter, period end | 2024-04-01 | 24Q1 |
dateq (deprecated, use quarter) |
Year Quarter | 2024-04-18 | Q2 2024 |
daybefore;MMMddyyyy |
Day before (full date) | 2021-01-01 | Dec 31, 2020 |
daybefore;MMMyyyy |
Day before, month & year | 2021-01-01 | Dec 2020 |
yearperiod;2 |
2 Years Period | 2024-04-18T22:46:27.639Z | 2024-2026 |
yearperiod;4 |
4 years Period | 2024-04-18T22:46:27.639Z | 2024-2028 |
| Currency formats | |||
currency;;0;2 |
Currency (Default) | 137890.95 | $137,890.95 |
currency;USD;0;2 |
Currency USD | 137890.95 | $137,890.95 |
currency;EUR;0;2 |
Currency EUR | 137890.95 | €137,890.95 |
currency;;2;2;a |
Accounting Currency | -137890.95 | ($137,890.95) |
currency;;2;2;z|- |
Currency, zero as dash | 0 | - |
currency;USD;0;2;c |
Compact Currency USD | 137890.95 | $137.89K |
currency;EUR;0;2;c |
Compact Currency EUR | 137890.95 | €137.89K |
| Text formats | |||
suffix; kg |
Suffix | 15 | 15 kg |
wrap;(;) |
Wrap | Category | (Category) |
ellipsis;10 |
Ellipsis | More than 10 letters | More th... |
ellipsis;10;middle |
Ellipsis (middle) | More than 10 letters | More...ers |
ellipsis;10;start |
Ellipsis (start) | More than 10 letters | ...letters |
Date examples use the en-US culture. A value that carries a time zone (ending in Z or an offset) is shown in the time zone the report renders in: 2024-04-18T22:46:27Z is April 19 east of UTC. A value without one is shown as written.
DateTime Format Specifiers¶
The dt format supports custom patterns using these specifiers. Separators and formatting are automatically applied based on the selected report language.
| Specifier | Description |
|---|---|
| Year | |
YYYY |
Full year |
YY |
Short year |
| Month | |
MMMM |
Long month name |
MMM |
Short month name |
MM |
Two-digit month |
M |
Numeric month |
| Day of month | |
dd |
Two-digit day of month |
d |
Day of month |
| Weekday | |
DDDD |
Full weekday name (Monday) |
DDD |
Short weekday name (Mon) |
DD |
Short weekday name (Mon) |
D |
Narrow weekday name (M) |
| Time | |
HH, hh |
Hours, two digits; 12- or 24-hour as the culture uses it |
H, h |
Hours (no padding); 12- or 24-hour as the culture uses it |
mm |
Minutes |
m |
Minutes (no padding) |
ss |
Seconds |
s |
Seconds (no padding) |
A, a, P, p |
Force the 12-hour clock with AM/PM (the culture sets their case) |
N, n |
Force the 24-hour clock |
Pattern Examples:
dt;yyyyMMdd- Year, month, daydt;MMMMyyyy- Long month name and yeardt;DDDDMMMddyyyy- Weekday name, month name, day, yeardt;HHmm- Hours and minutes, on the culture's clockdt;HHmmN- Hours and minutes, 24-hour clockdt;hmmA- Hours, minutes, AM/PM (12-hour clock)
The actual output format (separators, spacing) depends on the selected report language.
Number Format Parameters¶
Number formats support flexible decimal precision and formatting flags using the pattern n;min;max;flags (or number;min;max;flags).
Parameters:
min- Minimum number of decimal placesmax- Maximum number of decimal placesflags- Formatting options (can be combined)- Short form:
n;2sets both min and max to 2 decimals (same asn;2;2)
Available Flags:
c- Compact format (displays large numbers as K, M, etc.)a- Accounting format (negative numbers in parentheses). Works on number and percent (p,ps) formats in every language. Currency formats use the report language's own accounting style, so some languages keep the minus sign: -1537.6 withcurrency;EUR;0;0;ais (€1,538) in English and -1.538 € in Germanz- Show zero as the null text, the text after|in the format (empty when none is given)+- Always show sign (+ for positive, - for negative) - signDisplay = "exceptZero"
Examples:
n;0;2- 0-2 decimal places: 1537.2598 → 1,537.26n;2;2- Exactly 2 decimal places: 1537.2 → 1,537.20n;0;2;c- Compact with 0-2 decimals: 1537.2598 → 1.54Kn;0;2;+- Show sign with 0-2 decimals: 1537.26 → +1,537.26n;0;2;+c- Sign + compact: 1325 → +1.33Kn;0;2;a- Accounting format: -1537.26 → (1,537.26)p;1;1;a- Accounting percent: -0.052 → (5.2%)n;2;2;z|-- Zero as a dash: 0 → -, 1537.2 → 1,537.20n;2;2;az|-- Accounting, zero as a dashn;0;2;ac+- All flags combined: -1325 → (1.33K), 1325 → +1.33K
Accounting and Zero-as-Dash Formats¶
Two flags cover the usual needs of financial tables. Both go in the flags position of a number, percent or currency format, so the minimum and maximum decimals must be given first.
Accounting: negative values in parentheses¶
Add the a flag to show negative values in parentheses instead of with a minus sign. Positive values are not changed.
| Format | Value | Result |
|---|---|---|
n;0;0;a |
-1537.6 | (1,538) |
n;2;2;a |
-1537.26 | (1,537.26) |
n;2;2;a |
1537.26 | 1,537.26 |
p;1;1;a |
-0.052 | (5.2%) |
currency;USD;2;2;a |
-137890.95 | ($137,890.95) |
Number and percent formats use parentheses in every report language. Currency formats follow the report language's own accounting style, and some languages have none: currency;EUR;0;0;a shows -1537.6 as (€1,538) in English and as -1.538 € in German.
Zero as a dash¶
Add the z flag to replace zero with the text written after | at the end of the format. The same text is shown for empty values.
| Format | Value | Result |
|---|---|---|
n;2;2;z|- |
0 | - |
n;2;2;z|- |
1537.2 | 1,537.20 |
n;2;2;z|- |
(empty) | - |
n;2;2;z|n/a |
0 | n/a |
p;1;1;z|- |
0 | - |
n;2;2;z |
0 | (blank) |
Combining the two¶
The flags can be used together and with c and +: n;2;2;az|- shows -5 as (5.00) and 0 as -.
A value that rounds to zero at the shown precision counts as zero. With n;2;2;a, -0.001 is shown as 0.00, not (0.00); with n;2;2;z|- it is shown as -.
Currency Format Parameters¶
Currency formats follow the same parameter structure as numbers: currency;{currency-code};{min-decimals};{max-decimals};{flags} (or c;{currency-code};{min-decimals};{max-decimals};{flags}).
Parameters:
currency-code- ISO currency code (USD, EUR, etc.) - leave empty for defaultmin- Minimum number of decimal placesmax- Maximum number of decimal placesflags- Same formatting flags as numbers (c,a,z,+)- Short form:
currency;USD;2sets both min and max to 2 decimals
Examples:
currency;USD;0;2- USD with 0-2 decimals: 137890.95 → $137,890.95currency;EUR;2- EUR with exactly 2 decimals: 137890.9 → €137,890.90currency;USD;0;2;c- Compact USD: 137890.95 → $137.89Kcurrency;EUR;0;2;+- EUR with sign: 137890.95 → +€137,890.95currency;;0;2- Default currency: 137890.95 → $137,890.95