DEV Community

Ahmad-Aiman
Ahmad-Aiman

Posted on • Edited on

2 1

java problems

how do i round number in java?
for example: 12.45 to 12.5

should i use float or double as variable?

Top comments (1)

Collapse
 
phlash profile image
Phil Ashby

Hi Ahmad, 5 seconds with a search engine found this useful article:
baeldung.com/java-round-decimal-nu...

Please do a little research before posting such questions on dev.to 😄

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay