Features
The Overlay formatting engine is used to format strings or numbers.
These are its main features:
- Substrings can be extracted
- Word casing can be changed
- Time and lap times can be formatted
- Numbers can be formatted
- Ordinals can be added to integer numbers
Syntax
The Overlay formatting engine converts real time variable names and formatting commands within curly braces to strings.
For example, with 20 laps to go, the following string:
Laps to go: {lapsToGo}
would be converted to:
Laps to go: 20
The list of available real time variables depends on the overlay panel in which the formatting engine is used.
Real time variable can also be specified by index in the list of variables.
For example, if lapsToGo is the seventh variable in the list of variables, the following string would generate the same output:
Laps to go: {7}
Formatting
Formatting commands can be appended to real time variable names. They consist of:
- A single colon
- A formatting command
- Additional parameters
For example, to display time to go with 2 decimal places:
Time to go: {timeToGo:d2}
In this case, d is the formatting command and 2 is the parameter
Formatting commands
- w: shorten string to width. Parameter is width of substring
- f: start string at index. Parameter is index of first character of substring
- C: all capital. No parameters
- l: all lower case. No parameters
- c: first letter of each word capital. No parameters
- x: remove trailing digits. No parameters
- o: ordinal of number. No parameters
- d: format number, parameter is number of decimal places
- t: format time, parameter is number of decimal places
- tm: format time, minutes must be displayed, parameter is number of decimal places
- ts: format time, seconds must be displayed, parameter is number of decimal places
- tms: format time, minutes and seconds must be displayed, parameter is number of decimal places