Refactor: better rounding (#1594)

This commit is contained in:
Alex Christoffer Rasmussen
2025-06-05 06:13:49 +02:00
committed by arc-alex
parent 421183fe55
commit 33ac05ebee
10 changed files with 93 additions and 181 deletions
@@ -81,7 +81,7 @@ export function getFormattedTimer(
localisedMinutes: string,
options: FormattingOptions,
): string {
if (timer == null) {
if (timer == null || timerType === TimerType.None) {
return options.removeSeconds ? timerPlaceholderMin : timerPlaceholder;
}
@@ -98,7 +98,7 @@ export function getFormattedTimer(
}
}
let display = millisToString(timeToParse);
let display = millisToString(timeToParse, { direction: timerType });
if (options.removeLeadingZero) {
display = removeLeadingZero(display);
}