3.2.2.3.1. Datatype Format Strings
Locale-dependent parsing formats are provided in the main messages pack of the application or its components. They follow the logic of standard Java SE classes, such as DecimalFormat
(see https://docs.oracle.com/javase/tutorial/i18n/format/decimalFormat.html) or SimpleDateFormat
(see https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html).
The formats should be provided in the strings with the following keys:
-
numberDecimalSeparator
– decimal separator for numeric types.# comma as decimal separator numberDecimalSeparator=,
-
numberGroupingSeparator
– thousands separator for numeric types.# space as thousands grouping separator numberGroupingSeparator = \u0020
-
integerFormat
– format forInteger
andLong
types.# disable thousands grouping separator for integers integerFormat = #0
-
doubleFormat
– format forDouble
type. Note that symbols used for decimal and grouping separators are defined in their own keys shown above.# rounding up to three digits after decimal separator doubleFormat=#,##0.###
-
decimalFormat
– format forBigDecimal
type. Note that symbols used for decimal and grouping separators are defined in their own keys shown above.# always display two digits after decimal separator, e.g. for currencies decimalFormat = #,##0.00
-
dateTimeFormat
– format forjava.util.Date
type.# Russia date+time format dateTimeFormat = dd.MM.yyyy HH:mm
-
dateFormat
– format forjava.sql.Date
type.# United States date format dateFormat = MM/dd/yyyy
-
timeFormat
– format forjava.sql.Time
type.# hours:minutes time format timeFormat=HH:mm
-
offsetDateTimeFormat
– format forjava.time.OffsetDateTime
type.# date+time format with an offset from GMT offsetDateTimeFormat = dd/MM/yyyy HH:mm Z
-
offsetTimeFormat
– format forjava.time.OffsetTime
type.# hours:minutes time format with an offset from GMT offsetTimeFormat=HH:mm Z
-
trueString
– string corresponding toBoolean.TRUE
.# alternative displaying for boolean values trueString = yes
-
falseString
– string corresponding toBoolean.FALSE
.# alternative displaying for boolean values falseString = no
Studio allows you to set format strings for languages used in your application. Edit Project Properties, click the button in the Available locales field, then click Show data format strings. |
Format strings for a locale can be obtained using the FormatStringsRegistry
bean.