diff --git a/src/lib/timer.tsx b/src/lib/timer.tsx index d2e2ecf..210e0db 100644 --- a/src/lib/timer.tsx +++ b/src/lib/timer.tsx @@ -184,3 +184,10 @@ export function roundToTenth(hours: number): number { if (!hours || hours <= 0) return 0; return Math.max(0.1, Math.round(Math.ceil(hours * 10)) / 10); } + +/** Round hours UP to the nearest 1/6 hour (10-minute) increment, with 1/6 minimum. */ +export function roundToSixth(hours: number): number { + if (!hours || hours <= 0) return 0; + const sixths = Math.max(1, Math.ceil(hours * 6)); + return Math.round((sixths / 6) * 1000) / 1000; +}