fix download ETA dispay

pull/335/head
Alex Shnitman 2023-10-20 09:41:40 +03:00
parent fb6b4a1ec1
commit 0985f97b36
1 changed files with 3 additions and 3 deletions

View File

@ -9,14 +9,14 @@ export class EtaPipe implements PipeTransform {
return null; return null;
} }
if (value < 60) { if (value < 60) {
return `${value}s`; return `${Math.round(value)}s`;
} }
if (value < 3600) { if (value < 3600) {
return `${Math.floor(value/60)}m ${value%60}s`; return `${Math.floor(value/60)}m ${Math.round(value%60)}s`;
} }
const hours = Math.floor(value/3600) const hours = Math.floor(value/3600)
const minutes = value % 3600 const minutes = value % 3600
return `${hours}h ${Math.floor(minutes/60)}m ${Math.floor(minutes%60)}s`; return `${hours}h ${Math.floor(minutes/60)}m ${Math.round(minutes%60)}s`;
} }
} }