How to output a percent sign itself using boost.format?

How do you output a percent sign itself using Boost.Format?

i.e:

boost::format msg("5% complete"); // <- how to actually output the percent sign

Thanks!

Answers


Simply escape it with another percent sign

boost::format msg("5%% complete"); 

Need Your Help

Placeholder in contenteditable - focus event issue

javascript jquery focus contenteditable caret

I have been trying to ask this before, without any luck of explaining/proving a working example where the bug happens. So here is another try:

Distinct in LINQ with anonymous types (in VB.NET)

.net vb.net linq linq-to-objects distinct

Supposing the referenced List below contains 2 elements: