how can i write "%" in java printf method -


this question has answer here:

i want know how can write "%", in java printf() method.

for example : system.out.printf("it has %.4f%", a); hoped output : had 33.3333%

but, had unknownformatconversionexception error.

so, how can change that?

the % sign should escaped %. example:

system.out.printf("it has %%%.4f%%", a); 

will print: it has %33.3333%, a = 33.33333f;


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -