0
How do you format something in java?
I want to format the number 75 to two decimal places and show a pound sign
2 Answers
+ 11
float value = 75.0f;
System.out.printf("%.2fquot;, value);
+ 1
You have variable declare as
Float floatValue;
To print number with decimal places
System.out.println(String.format("%.2f", floatValue));