STYLE function help [1] includes this phrase: > Since STYLE() has a numeric return value of zero, this return value gets appended > to a string. This can be avoided using T() as in the following example: The phrase goes immediately after an example that does not append any strings, just uses a sole STYLE function in a simple formula. The following example deals with a complex formula case, when a user wants to use the formula to define a non-empty textual cell value, and at the same time, to set a specific style without affecting the displayed string content. The example uses STYLE inside T(), which returns an empty string, which does not modify the result when appended to the previous string. So likely, the context was the discussion how to use the function in different scenarios; and in case of numeric expressions, like =A1*B2 when one wants to use the STYLE function in the same formula, the natural way is to *add* its return value (which is always 0): =A1+B2 + STYLE(...) => shows the result of A1*B2+0, and assigns the style ... but this approach does not work with textual content: it will either convert it into a number, like in ="1" + STYLE(...) => instead of text "1", the cell will have number 1 or will result in an error: ="ABC" + STYLE(...) => #VALUE! The intuitive solution seems to be using & instead of +: ="ABC" & STYLE(...) => unwanted result: "ABC0" ... and now the problematic phrase in the help describes the correct solution. [1] https://help.libreoffice.org/7.4/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id3149425
Indeed the text and examples can be improved. I'm setting this to NEW.
I improved the text and examples in the help file. Proposed patch available for review at: https://gerrit.libreoffice.org/c/help/+/145299
Rafael Lima committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/20d4c17ca1fb161bf5fccf3d94db93b0a4d322f2 tdf#152412 Improve the STYLE function help page
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/379510d74d95dd4e7878e8e86401a3b60a6ef107 Follow-up: tdf#152412 Re-add the note to the STYLE() function