Putting a percentage sign label in the StrFormat

Is there a way to display a title line (with a percentage sign in it) like below without having the system thinking the last character is a placeholder and crash ? Thanks in advance.

_SECTION_BEGIN( "test" );
_N( Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} This is a percentage sign = %"));
_SECTION_END();

You need to always consult the manual:

% is a FORMAT SPECIFIER character you can't use it alone in StrFormat() call.

The manual clearly says:

Note 3: to print a single percent-sign character, you can not type % alone, you must use %%.

To print actual percent sign within first parameters of StrFormat you must type %% (TWO percent signs) as it is special sequence that means actual percent sign.

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.