%d
goes with integer in Java. Use %f
instead in your printf()
Another useful info. If you use %.02f
then it will print only two decimal point value after the dot .
%d
goes with integer in Java. Use %f
instead in your printf()
Another useful info. If you use %.02f
then it will print only two decimal point value after the dot .