January 3, 2019, 7:05pm
I have noticed that some items and sitemap entries require a “[%s]” be added in the label section for it to work properly.
Can someone please explain when it is required and when it is not required as I have not been able to figure it out.
January 3, 2019, 8:07pm
For this occasion I’m just referring to a post I made earlier today:
What you are asking about is called String formatting. For example:
[%.1f °C]: %.1f means that at that point a floating point number is to be filled in, with 1 digit after the decimal separator (the .), followed by the unit degrees Celcius in this case, but that could be anything.
[%d %%]: %d means that a integer number is to be filled in there, and it should be followed by a percentage sign (%), but as the % is already a special character, it is escaped by adding another % in front of it.
January 3, 2019, 8:11pm
%s displays the item value as a string (which only makes sense for string-type items).
It isn’t required but the only way to display the value in a sitemap (else it’s just displaying the rest as static text).
label= in sitemaps overrides what is set in the item definition, so you can do it there, too.
January 5, 2019, 1:02am
This answers my question, thank you both.
January 5, 2019, 10:21am
Tick the solution checkmark please for others to find this thread.