import time


def ms_time_to_srt_time_format(d: int) -> str:
    """Convert decimal durations into proper srt format.

    ms_time_to_srt_time_format(3890) -> '00:00:03,890'
    """
    sec, ms = d // 1000, d % 1000
    time_fmt = time.strftime("%H:%M:%S", time.gmtime(sec))

    # if ms < 100 we get ...,00 or ...,0 when expected ...,000
    ms = "0" * (3 - len(str(ms))) + str(ms)

    return f"{time_fmt},{ms}"