Javascript examples for Math:ceil
Round a float up to the next integer with Math.ceil
<html> <head></head> <body> <script> var n = 35.85001;//from w w w . ja va 2 s. co m console.log(Math.ceil(n * 100) / 100); // 35.86 var n = 35.800001; console.log(Math.ceil(n * 10) / 10); // 35.9 var n = 35.00001; console.log(Math.ceil(n)); // 36 </script> </body> </html>