Announcements
cancel
Showing results for
Did you mean:
Contributor II

## How round a time to the nearest minute?

I have the following expression: Interval(Sum(uren)/24, 'h:mm:ss')

The value of Sum(uren) = 38,75

The result of my expression = 38:44:59

How do get the following result?: 38:45 (rounded to the nearest minute)

Labels (1)
• ### General Question

1 Solution

Accepted Solutions
Specialist

round your result to the nearest minute?

Interval(round(Sum(uren)/24,1/(24*60)), 'h:mm')

"interval()" is just a formatting function..

10 Replies
Partner - Specialist

38,75 should return exactly 38:45.

Maybe this works: Interval( ROUND( Sum(uren) , 0.01 ) /24, 'h:mm:ss')

Contributor II
Author

Thanks Mruehl. But the result is stil 38:44:59.

Partner - Contributor III

Hello @Hans_K

try this : Interval(Sum(uren)/24, 'h:mm')

Or change the format of your measure in the vizualisation for Duration and change 'h:mm:ss'

Specialist

round your result to the nearest minute?

Interval(round(Sum(uren)/24,1/(24*60)), 'h:mm')

"interval()" is just a formatting function..

Contributor II
Author

Thanks Pierrick, but still 38:44.

Contributor III

I think you need to use "ceil" as a function, in order to round to next higher minute.

Contributor II
Author

Thanks Mikaelsc!

The 3th column result is now 38:45. My next challenge is the total-value, that's still 38:44.

Contributor II
Author

Thanks Enno86.

It's not the next higher minute. It's the nearest minute. If it's 38:44:29 it should be 38:44.