def morton_to_string(dim, k, morton_code):
    """
    Creates a string representation of the morton code

    Args:
        dim: Dimension represented by morton code
        k: Bits to represent each coordinate with
        morton_code: The morton code in integer format

    Returns:
        String representation of the binary morton code
    """

    return "{0:0{digits}b}".format(morton_code, digits=dim*k)