Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
ca46507f7b
commit
d7c6f8eeee
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user