Home > Instructions > Content > Field value formatter

Field value formatter

Field value format is used to control how the values of the feature fields are displayed.

Each layer's field can have its own value format specified. The formatting is then used, when some feature from this layer is displayed.

value format

The field value itself is represented in the value formatting script by a variable named value. The script must be kept compact, must not contain addition function definitions, and must be written as an expression.

So scripts like "value", "value * 2", "Math.sin(value)", "value + 'test'" are valid, but scripts like "return value", "value;", "if (value)" are not valid. Note that no trailing semicolon should be used.

Examples:

round(value, 2) 
datetime(value, 'yyyy') 
"Length: " + length(value) + "m"