0

How to I make the answer display in two decimal places?

runningCalories  = 0.0175 * RUNNING_METS * weight * TIME_RUNNING;
System.out.println(name + " burned an estimated " + runningCalories + " calories running.");
hstevens
  • 1
  • 1

1 Answers1

0

Use:

System.out.printf("%s burned an estimated %.2f calories running.", name, runningCalories);
Dando18
  • 622
  • 9
  • 22