Hola,
A ver qué tal parece algo así...
Código Delphi
[-]
function NormalizeString(str: string;
maxStr: integer=10): string;
begin
result := '';
if (Length(str) < maxStr) then
while(Length(result) < (maxStr-Length(str)))do
result := result+'0';
result := result+str;
end;