Dan Nissenbaum Dan Nissenbaum - 26 days ago 10
C++ Question

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!

Answer

Simply escape it with another percent sign

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