round up javascript

JavaScript
var ceiling1 = Math.ceil(4.7); //5 
var ceiling2 = Math.ceil(-3.4); //-3+3.5 => +3.0
-3.5 => -4.0

+3.5 => +3.0 using Math.floor()
-3.5 => -3.0 using Math.ceil()Math.round(3.14159)  // 3
Math.round(3.5)      // 4
Math.floor(3.8)      // 3
Math.ceil(3.2)       // 4
using Math.floor

console.log(Math.floor(5.95));
// expected output: 5

console.log(Math.floor(5.05));
// expected output: 5

console.log(Math.floor(5));
// expected output: 5

console.log(Math.floor(-5.05));
// expected output: -6

Source

Also in JavaScript: