feat(web+android): Gesamtdauer mit Stunden, in Android neu
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c7fed82736
commit
37f8f8acac
7 files changed
+50
-7
No files matched your search
@@ -47,6 +47,17 @@ export function formatDur(s) {
|
||||
return `${m}:${sec.toString().padStart(2,'0')}`;
|
||||
}
|
||||
|
||||
// Gesamtdauer einer Playlist oder eines Albums. Ab einer Stunde werden Stunden ausgewiesen —
|
||||
// "134 Min." muss man sonst selbst umrechnen, und bei einer Playlist mit 2000 Titeln steht dort
|
||||
// sonst eine vierstellige Minutenzahl.
|
||||
export function formatGesamtdauer(sekunden) {
|
||||
const min = Math.round((sekunden || 0) / 60);
|
||||
if (min < 60) return `${min} Min.`;
|
||||
const std = Math.floor(min / 60);
|
||||
const rest = min % 60;
|
||||
return rest ? `${std} Std. ${rest} Min.` : `${std} Std.`;
|
||||
}
|
||||
|
||||
// Fan/count formatting in German: full grouped number up to a million (559534 → "559.542"),
|
||||
// then compact millions (1200000 → "1,2 Mio.").
|
||||
export function fmtCount(n) {
|
||||
|
||||
Reference in new issue
Block a user