def to_lvm_size(number_of_bytes, fmt='%.1f'):
    """Inverse of lvm_size() using numeric string format @fmt."""
    size = float(number_of_bytes)
    if size >= 1024 ** 3:
        return (fmt + 'G') % (size / 1024 ** 3)
    elif size >= 1024 ** 2:
        return (fmt + 'M') % (size / 1024 ** 2)
    elif size >= 1024:
        return (fmt + 'K') % (size / 1024)
    return '%dB' % size
