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


plus2net.com



Post your comments , suggestion , error , requirements etc here




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