CJCoding With Joseph
15per day

Float Formatting

Create a float variable with the value 7.456. Use System.out.printf to print the value in the sentence:

My float is: 7.46

Make sure it only shows 2 decimal places.

Expected Output:

My float is: 7.46
Topics:
Printing
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.