def score_to_formatted_string(score, characters=9):
    """Transform a number (score) into a best-format string.

    The format will be either int (2234), float (10.234) or engineering
    (1.20E5), whichever is shorter. The score is then padded with left
    whitespaces to obtained the desired number of ``characters``."""
    raw = str(int(score) if (int(score) == score) else score)
    as_float = "%.02f" % score
    as_eng = "%.02E." % score
    return min([raw, as_float, as_eng], key=len).rjust(characters)