def xact_category(xact):
    """Format a category hierarchy adding a separator"""

    category = xact["category"]
    cname = category[0]

    if len(category) > 1:
        for c in category[1:]:
            if len(c) > 0:
                cname += ":" + c
    return cname