String.Format ()

Is "% 11.2lf" equivalent in C ++?

Do you have a resource that shows equivalent formats for Java and C ++?

+4
source share
3 answers

Short answer: Java equivalent "%11.2f" .

In argument C printf() (but not scanf() ), %f and %lf are equivalent; Both take a double . %lf are equivalent; Both take a double .

In Java Formatter.format() , %f is legal, but %lf is not. %f works for Float , Double, and BigDecimal values.

+5
source
+2
source

Formatting format. http://www.boost.org/doc/libs/1_37_0/libs/format/doc/format.html#syntax

It has basically the same forms as printf ().
But they are type safe and can be used in threads.

0
source

All Articles