Formatting syntax
Date/time formatting
Numerical value formatting
Text string formatting
Note: The illustrated examples assume that the PC localization options are set to the default values for EN.
Date/time formatting
The syntax described in this chapter is applicable to fields that return a date / time value.
The format string can consist of one of the keywords that identify the predefined or compound formats using the syntax for the custom format.
|
Syntax |
Description
|
|
General Date |
Display date and / or time corresponding to the specified number
|
|
Long Date |
Displays the date formatted according to the system location settings related to the date in extended format. |
|
Medium Date |
Displays the date formatted according to the system location settings related to the date in medium format. For example: 14-Sep-04 |
|
Short Date |
Displays the date formatted according to the system location settings related to the short format date. For example: 09/14/2004
|
|
Long Time |
Displays the time using the system localization settings related to the extended time format; includes hours, minutes, seconds. For example 15.45.23
|
|
Medium Time |
Displays the time in 12-hour format using hours, minutes and AM / PM qualifier. For example 03.45 PM
|
|
Short Time
|
Displays the time in 24-hour format. For example 17:45.
|
Examples:
|
Format |
Expression |
Result |
|
Long Date |
Now |
Friday 19 October 2007 |
|
Short Time |
Now |
09.43 |
« back to Date/Time formatting
« Top
The following characters can be combined to create a custom date / time format.
|
Character |
Description
|
|
(:) |
Time Separator. Depending on the current location settings, other characters can be used as a separator. The separator divides hours, minutes and seconds into formatting. The character actually used as a separator is determined by the system location settings. Note: the character is intended without brackets.
|
|
(/) |
Date separator. Depending on the current location settings, other characters can be used as a separator. The separator divides the digits relative to day, month and year in the formatting. The character actually used as a separator is determined by the system location settings. Note: the character is intended without brackets.
|
|
d |
Displays the day of the month as a number without a leading zero (for example, 1).
|
|
dd |
Display the day of the month formatting it in two digits (For example, 27 or 01)
|
|
ddd |
Displays the abbreviated day name in the local language (for example "Mon")
|
|
dddd |
Displays the full name of the day in the local language (for example "monday")
|
|
M |
Displays the number of the month with no leading zero (for example, January is represented with 1). |
|
MM |
Displays the month number formatted in two digits (for example, January is represented with 01)
|
|
MMM |
Displays the abbreviated month name, in the local language (for example, Jan).
|
|
MMMM |
Displays the name of the month in full, in the local language (for example, January).
|
|
h |
Displays the time without an initial zero with a 12-hour system (e.g., 2:27:15).
|
|
hh |
Displays the time formatted in two digits, with 12-hour system (for example, 02:27:15).
|
|
H |
Displays the time without an initial zero with a 24-hour system (for example, 14:27:15).
|
|
HH |
Displays the formatted two-digit time with 24-hour system (as an example, 6:08:15).
|
|
m |
Displays the minutes with no leading zero (for example, 12: 1: 15).
|
|
mm |
Displays the minutes formatted in two digits (for example, 12:01:15). |
|
s |
Visualizza i secondi senza zero iniziale (ad esempio, 12:15:5).
|
|
ss |
Displays the seconds with leading zero (for example, 12: 15: 05).
|
|
w |
Display the number of the day of the week. For example, 1 for Monday, 2 for Tuesday, etc.
|
|
ww |
Displays the week number in the year (1-51)
|
|
y |
Display the day of the year (1-355 / 6)
|
|
yy |
Displays the year formatted in two digits, with initial zero for years less than ten. (for example 04 for 2004).
|
|
yyyy |
Displays the year in four digits (for example, 2004)
|
Examples:
|
Format |
Express. |
Result |
|
h:mm:ss |
Time |
2:05:09 |
|
H:mm:ss |
Time |
14:05:09 |
|
HH:mm:ss |
Time |
02:05:09 |
|
dddd d MMMM yyyy |
Date |
Wednesday 8 September 2004 |
|
mm/gg/yy |
Date |
09/08/04 |
|
ddd dd MMM yy " – " hh:mm |
now |
wed 08 sep 04 – 09:05 |
|
Week " ww "Day " w |
Date |
Week 37 Day 3 |
« back to Data/Time formats
« Back to Top
Numerical values formatting
The syntax described in this chapter is applicable to fields that return a numerical value that must be formatted as such.
The format string can consist of one of the keywords that identify the predefined or compound formats using the syntax for the custom format.
|
Sintax |
Description
|
|
General Number
|
Display the number without thousands separator |
|
Currency |
|
|
Fixed |
Display at least one digit on the left and two digits to the right of the decimal point.
|
|
Standard |
Displays a number with thousands separator, and at least one digit on the left and two digits to the right of the decimal point.
|
|
Percent |
Displays the number formatted as a percentage (multiplied by 100 and followed by the "%" sign, always displaying two digits to the right of the decimal point.
|
|
Scientific |
Displays the number in scientific notation, with two significant decimal digits.
|
|
Yes/No |
Display No if the numeric value of the expression is 0; YES if different from 0. The texts No and Yes are expressed in the local language.
|
|
True/False |
Display False if the numeric value of the expression is 0; True if the value is not equal to 0. The True and False texts are expressed in the local language.
|
|
On/Off |
Display Off if the numeric value of the expression is 0; On if different from 0. |
Examples:
|
Format |
Express. |
Result |
|
Currency |
ITEM1 |
€ 1.234,56 while ITEM1 =1234,567
|
|
Percent |
ITEM1 |
5,00 % while ITEM1 = 0,05
|
|
on/off |
ITEM1 |
ON while Item1 <> 0
OFF while Item1 = 0 |
« back to Data/Time formats
« Back to Top
Custom numerical formats
The following characters can be combined to create a custom format. The characters are shown in brackets to make them easier to read. The brackets must be omitted.
|
Character |
Description
|
|
(0) |
Digit placeholder. Represents a zero or a non-zero digit. If the expression has a digit in the position corresponding to the 0 position in the formatting string, that digit is displayed; otherwise a 0 is displayed.
|
|
(#) |
Digit placeholder. Display a digit or nothing. If the expression has a digit in the position corresponding to the position of # in the formatting string, it is displayed; otherwise, nothing is displayed in that position.
|
|
(.) |
Placeholder of the decimal separator. The position of the decimal separator determines the number of digits of the integer part and the decimal part.
|
|
(%) |
Percent placeholder. Multiply the value by 100 and insert the % character at the position where that character appears in the formatting string.
|
|
(,) |
Placeholder of the thousands separator. The thousands separator separates the number of thousands from the number of hundreds into a number with four or more whole digits.
|
|
(E- E+ e- e+) |
Scientific format indicator (exponential). If the formatting string contains at least one digit placeholder (0 or #) to the left of the character E-, E +, e-, or e +, the number is displayed in scientific format, and E or e are inserted between the number and its decimal exponent.
|
|
- + $ ( ) |
Literal characters. These characters are displayed exactly as entered in the formatting string. To display another character, not included among those listed, you must precede it with a backslash (\) or enclose it in double quotes (""). |
|
(\) |
Functional inhibitor. Displays the immediately following character in the formatting string exactly as it is written, ignoring its symbolic meaning. The character (\) is not displayed. This writing is equivalent to enclosing the character in double quotes (""). To display the backslash character (\) enter two (\\).
|
|
("…") |
The characters enclosed in double quotes are displayed exactly as entered, ignoring their symbolic meaning, exactly as they are for characters preceded by (\). |
Examples:
|
Format |
Express. |
Result |
|
000.00 |
ITEM1 |
1234,12 while ITEM1 =1234,123
1234,57 while ITEM1=1234,567
012,30 while ITEM1 = 12,3
|
|
###.## |
ITEM1 |
1234.12 while ITEM1 =1234,123
1234.57 while ITEM1=1234,567
12,3 while ITEM1 = 12,3
|
|
###.00 |
ITEM1 |
1234.12 while ITEM1 =1234,123
1234.57 while ITEM1= 1234,567
12,30 while ITEM1 = 12,3
,25 while ITEM1 = 0,25
|
|
##0.00 |
ITEM1 |
1234.12 while ITEM1 =1234,123
1234.57 while ITEM1=1234,567
12,30 while ITEM1 = 12,3
0,25 while ITEM1 = 0,25
|
« Back to Numeric values formatting
« Back to Top
String formatting
The syntax described in this chapter is applicable to fields that return an alphanumeric value or a numeric value to be treated as a text string. The format string can be composed using the formatting characters shown below.
|
Character |
Description
|
|
@ |
Placeholder of character. Display a character or a space. If the string has a character in the position corresponding to that of @ in the formatting string, the character is displayed. Otherwise, a space is displayed in that position.
|
|
& |
Placeholder of character. Display a character or nothing. If the string has a character in the position corresponding to & in the formatting string, the character is displayed. Otherwise, nothing is displayed in that position.
|
|
< |
Force string conversion to lowercase
|
|
> |
Force string conversion to uppercase
|
|
! |
Force compilation from left to right of placeholders (by default the placeholders are filled in from right to left). |
Examples:
|
Format |
Express. |
Result |
|
@@@@@ |
ITEMTX |
<4 spazi>A while ITEMTX= “A”
ABCDEF while ITEMTX= “ABCDEF”
|
|
!@@@@@ |
ITEMTX |
A<4 spazi> while ITEMTX= “A”
ABCDEF while ITEMTX= “ABCDEF”
|
|
&&&&& |
ITEMTX |
A while ITEMTX= “A”
ABCDEF while ITEMTX= “ABCDEF”
|
|
> |
ITEMTX |
ABCD while ITEMTX = “abcd”
|
|
< |
ITEMTX |
abcd while ITEMTX = “ABCD”
|
« Back to Top