//only rounds up 15 can be changed to what ever number you want to use
roundMinutes = (mins) => { return (~(mins / 15) * 15) * -1 ; }
roundMinutes(35) -> 45
// will now round down instead of up
roundMinutes = (mins) => { return (~~(mins / 5) * 5) ; }
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
//only rounds up 15 can be changed to what ever number you want to use
roundMinutes = (mins) => { return (~(mins / 15) * 15) * -1 ; }
roundMinutes(35) -> 45
// will now round down instead of up
roundMinutes = (mins) => { return (~~(mins / 5) * 5) ; }