java round to nearest 5
int x = 3.14;
Math.round(x);
//Rounds to nearest int
Math.ceil(x);
//Rounds up to int
Math.floor(x);
//Rounds down to int
4
8
5*(Math.round(number/5));
Thank you!
8
0
Are there any code examples left?
New code examples in category Java