0

why there us not a single method for values to round up there are 2 methods floor and ceil

if value 6.25 we have to round up then its value after dot is 25 so rounded value is 6 And for value 6.75 we have to round up then its value after dot is 75 so rounded value is 7

20th Oct 2016, 9:19 AM
Onkar Ashok Gumate
Onkar Ashok Gumate - avatar
1 ответ
+ 5
Math.floor() to round down Math.ceil() to round up Math.round() to round to the closest int
20th Oct 2016, 10:08 AM
Zen
Zen - avatar