Value Display
Value Display allows you to apply a format to display the value in a more readable way. This is useful in some places like:
You can apply the format by specifying it as:
{value_<format>}
<holder>;value;<format>
<holder>;top_value;<position>;<format>
Or just the <format> string in default-value-display.
The following section will guide you through the available formats to replace
<format>.
Available Formats
Decimal Format
Format:
decimal:setting1=value1&setting2=value2
| Setting | Description | Default | Example |
|---|---|---|---|
decimalSeparator | The character used to separate the integer part from the fractional part | . | decimalSeparator=. |
groupingSeparator | The character used to separate groups of digits to the left of the decimal separator | groupingSeparator=, | |
groupingSize | The number of digits in each group to the left of the decimal separator | groupingSize=3 | |
maximumFractionDigits | The maximum number of digits allowed in the fractional part of the number | maximumFractionDigits=2 |
Example
default-value-display)decimal:decimalSeparator=.&groupingSeparator=,&groupingSize=3&maximumFractionDigits=2line (as placeholder){value_decimal:decimalSeparator=.&groupingSeparator=,&groupingSize=3&maximumFractionDigits=2}value query<holder>;value;decimal:decimalSeparator=.&groupingSeparator=,&groupingSize=3&maximumFractionDigits=2top_value query<holder>;top_value;<position>;decimal:decimalSeparator=.&groupingSeparator=,&groupingSize=3&maximumFractionDigits=2Time Format
Format:
time:setting1=value1&setting2=value2
| Setting | Description | Default | Example |
|---|---|---|---|
pattern | The pattern describing the date and time format. There are short forms to pattern (see Short Form) | HH:mm:ss | pattern=HH:mm:ss |
type | The type of the time: duration or time | duration | type=duration |
unit | The unit of the time: ticks, nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days | seconds | unit=seconds |
Example
default-value-display)time:pattern=HH:mm:ss&type=duration&unit=secondsline (as placeholder){value_time:pattern=HH:mm:ss&type=duration&unit=seconds}value query<holder>;value;time:pattern=HH:mm:ss&type=duration&unit=secondstop_value query<holder>;top_value;<position>;time:pattern=HH:mm:ss&type=duration&unit=secondsShort Form
There are some short forms to the pattern for conveniently defining the format
without remembering too much of the syntax.
Depending on the type of the time, there are different short forms. Here is a
list of the different short forms based on the type:
type=durationpattern=default: Use the formatHH:mm:sspattern=word: Use a format that describes the duration in words (e.g.1 day 1 hour 2 minutes 30 seconds)pattern=short: Use the formatH:mm:sspattern=short-word: Use the formatd'd 'H'h 'm'm 's's'(e.g.1d 1h 2m 30s)
type=time- The available short forms of the
patterncan be found in the Predefined Formatters of theDateTimeFormatter - For example, if you want to use
ISO_LOCAL_DATE, the setting will bepattern=ISO_LOCAL_DATE
- The available short forms of the
Shorten
Format:
shortenorshorten:number1=suffix1&number2=suffix2
This is a format that shorten the number to the nearest "number group" (e.g.
1000 will be 1k)
The default behavior will support the following groups:
1,000to1k1,000,000to1M1,000,000,000to1B1,000,000,000,000to1T
You can also define a list of custom groups by specifying them as settings in
pair of number and suffix. For example: shorten:1000=k&100000=hk&1000000=m
would shorten the number based on the following groups:
1,000to1k100,000to1hk1,000,000to1m
Example
default-value-display)shortenline (as placeholder){value_shorten}value query<holder>;value;shortentop_value query<holder>;top_value;<position>;shorten