const formattedDuration = (duration: number): string => {
const sec = duration % 60
const min = Math.floor(duration / 60)
return `${min}min${sec > 0 ? ` ${sec}s` : ''}`
}
formattedDuration(600)
//=> "10min"
formattedDuration(640)
//=> "10min 40s"
formattedDuration(6640)
//=> "110min 40s"
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)