Angular pipe hour and minute format [duplicate]

Discussão em 'Angular' iniciado por Andrea, Janeiro 8, 2025.

  1. Andrea

    Andrea Guest

    How can you pipe a number in Angular that comes in minutes, like 450 to look like this 07:30:00 in hours. I only managed to make it look like this 7.5h using the following pipe:

    transform(value: number): string {
    if(value > 0 && value/60 < 1) {
    return value + ' m';

    } else {
    return value/60 + 'h';
    }
    }

    Continue reading...

Compartilhe esta Página