Código
//Preencher é o caracter o qual será colocado a direita do numero original
//TamString é o tamanho final da string retornada, já com os caracteres a direra
Function fPreencher( const Conteudo : Integer; Const Preencher : String; const TamString : Integer ): String;
Var
qtdFor, i : Integer;
vFull : String;
begin
qtdFor := Length( IntToStr( Conteudo ) );
vFull := '';
If qtdFor >= TamString Then
result := RightStr( IntToStr( Conteudo ), qtdFor )
else
begin
qtdFor := TamString - QtdFor;
For i := 1 to qtdFor do
vFull := vFull + Preencher;
Result := vFull + IntToStr( Conteudo );
end;
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009