With Format Codes, you define the output format of numeric or date/time values. You can either select one of the predefined Format Codes from the given drop-down lists, or enter your own Format Code in the Expression Editor.
NOTE
Format Codes do not start with an equals sign!
You can use the following placeholders:
Format Code | Description |
|---|---|
|
0 |
Zero placeholder. The number is always displayed, even if it is 0. |
|
# |
Digit placeholder. The number is only displayed if it is different than 0. |
|
. |
Decimal point as defined by the country settings. |
|
, |
Group separator. Show a thousand separator, if required, as defined by the country settings. |
|
F1 |
Show the number with 1 digit using the decimal point and group separator as defined by the country settings. |
|
F2 |
Show the number with 2 digits using the decimal point and group separator as defined by the country settings. |
|
F3 |
Show the number with 3 digits using the decimal point and group separator as defined by the country settings. |
|
d |
Date (1/17/2022). |
|
dd |
Day of the month (01—31) |
|
hh |
Hour (01—12) |
|
HH |
Hour (01—24) |
|
m or M |
Month and Date (January 17) |
|
mm |
Minute (01—59) |
|
MM |
Month (01—12) |
|
MMM |
Abbreviation of the Month |
|
ss |
Second (01—59) |
|
tt |
AM/PM designator |
|
yy |
Year (00—99) |
|
zzz |
Offset from UTC time zone |
The following table shows some examples of how the Format Code defines the output format.
Value | Format String | Output |
|---|---|---|
|
0.123 |
#.## |
.12 |
|
|
0.## |
0.12 |
|
|
0.#### |
0.123 |
|
|
0.0000 |
0.1230 |
|
|
F1 |
0.1 |
|
|
F2 |
0.12 |
|
2/27/2007 5:11:30 PM |
HH:mm:ss |
17:11:30 |
|
1/17/2022 5:11:30 PM |
dd/MM/yy |
17/01/22 |
|
1/17/2022 5:11:30 PM |
hh tt |
05 PM |
|
2/27/2007 6:11:30 PM |
zzz |
+01:00 |
For more information on the Format Codes, refer to the MSDN library (http://msdn.microsoft.com/en-us/library/26etazsy(v=VS.100).aspx).
base-id: 11032033291
id: 9007210286774283