• What you have is code that will add the necessary leading spaces up to 10. In effect it will leave you with a right-aligned 10 character field.

    It is unnecessarily complicated, IMHO, but that's what it does.

    If you want the field to be left-aligned, then simply delete the first half (up to and including the plus-sign). The first half is what adds the spaces to right-align up to a field-lenght of 10.