JSFiddle - React, Tailwind, and code Playground

JavaScript

function convert(value) {
    alert(Math.floor(value / 60) + ":" + (value % 60 ? value % 60 : '00'))
}

convert(180)
convert(190)