def right_align(value, length):
    """
    :param value: string to right align
    :param length: the number of characters to output (spaces added to left)
    :return:
    """
    if length <= 0:
        return u""

    value = text_type(value)

    if len(value) < length:
        return (" " * (length - len(value))) + value
    else:
        return value[-length:]