0

This is a short and hopefully simple question, but I am trying to display an integer (if the product equals an integer), but I am wondering how to display the first 2 decimal places instead of the whole long one? For example: 48.23 instead of 48.2398484848438434323324

Thank you.

1 Answers1

0
System.out.printf("%.2f",48.2398484848438434323324);
Anubian Noob
  • 13,426
  • 6
  • 53
  • 75