ClimoC
Well-known Member
- Joined
- Aug 21, 2009
- Messages
- 584
Anyone come across this before?
Essentially, trying to round like this:
04:01:00 to 04:00:00
04:02:00 to 04:00:00
04:03:00 to 04:00:00
04:04:00 to 04:05:00
04:06:00 to 04:05:00
04:07:00 to 04:05:00
04:08:00 to 04:05:00
04:09:00 to 04:10:00
etc
so kind of like normal rounding to 5 min intervals, which I've sorted, but I need to move the floor/ceiling so that 4's and 9's go up, and 1's,2's,3's go to 0 and 6's 7's and 8's go down to 5
Bit of monday-brainness, and in the middle of an 800 line script (not including functions) and wanted an elegant function solution.
Can't use mod obviously...
Essentially, trying to round like this:
04:01:00 to 04:00:00
04:02:00 to 04:00:00
04:03:00 to 04:00:00
04:04:00 to 04:05:00
04:06:00 to 04:05:00
04:07:00 to 04:05:00
04:08:00 to 04:05:00
04:09:00 to 04:10:00
etc
so kind of like normal rounding to 5 min intervals, which I've sorted, but I need to move the floor/ceiling so that 4's and 9's go up, and 1's,2's,3's go to 0 and 6's 7's and 8's go down to 5
Bit of monday-brainness, and in the middle of an 800 line script (not including functions) and wanted an elegant function solution.
Can't use mod obviously...