Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 2x 2x 11x 11x 11x 11x | import l10n from "shared/lib/lang/l10n";
export const msToHumanTime = (milliseconds: number): string => {
const totalSeconds = milliseconds / 1000;
const minutes = Math.floor(totalSeconds / 60);
const seconds = totalSeconds % 60;
return minutes > 0
? l10n("FIELD_TIME_MINUTES_AND_SECONDS", {
minutes,
seconds: Math.floor(seconds),
})
: l10n("FIELD_TIME_SECONDS", { seconds: parseFloat(seconds.toFixed(2)) });
};
|