DEV Community

Ahmad-Aiman
Ahmad-Aiman

Posted on • Updated on

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 😄