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

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -