• Kursy
  • Kompilator kodu
  • Dyskusja
  • Cennik
  • Zespoły
Menu
0

How to round number after decimal useing double

Example 38.567 but I want the print to say 38.57?

java
24th Sep 2017, 6:23 PM
Joshua Smith
Joshua Smith - avatar
1 Odpowiedź
+ 15
System.out.printf("%.2f", 38.567);
24th Sep 2017, 6:26 PM
Dev
Dev - avatar

Często masz takie pytania?

Ucz się bardziej efektywnie, za darmo:

  • Wprowadzenie do Pythona

    7.1M uczących się

  • Wprowadzenie do Java

    4.7M uczących się

  • Wprowadzenie do C

    1.5M uczących się

  • Wprowadzenie do HTML

    7.5M uczących się

Zobacz wszystkie kursy
Popularne dzisiaj
I've a HTML code question
2 Votes
How my gradient is so mess I code in vscode and copied here to ask some questions please help me with this one too
1 Votes
C++
1 Votes
HELP ME LEARN
1 Votes
Please tell me about methods
1 Votes
Appointment Booking website
0 Votes
Does anyone know how to go to another "page" on the same page using the HTML button tag?
2 Votes
Can I learn both graphic design and web development at the same time?
0 Votes
Mentors
1 Votes
How do i learn php in here?
1 Votes