SyntaxFix
Write A Post
Hire A Developer
Questions
%d is for integers use %f instead, it works for both float and double types:
%d
%f
float
double
double d = 1.2; float f = 1.2f; System.out.printf("%f %f",d,f); // prints 1.200000 1.200000