Math.round()

Returns the nearest integer after rounding up .
Syntax
Math.round(double input_number)
Output is a rounded value.
	System.out.println(Math.round(12.34)); //12
	System.out.println(Math.round(12.67)); //13
	System.out.println(Math.round(12));    //12
	    
	System.out.println(Math.round(-12.34)); //-12
	System.out.println(Math.round(-12.67)); //-13
	System.out.println(Math.round(-12));    //-12
Using double
	double my_data=Math.round(12.34);
	System.out.println(my_data); //12.0


All Math functions
Java


plus2net.com






We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer