maxzama,
Cita:
|
Empezado por maxzama
...Como puedo agregar los 0 al contrario. Es decir agregar lo cero a la derecha...
|
Revisa este código:
Código Delphi
[-]
procedure TForm1.Button3Click(Sender: TObject);
var
LenStr : Integer;
AuxStr : String;
i : Integer;
begin
AuxStr := Edit1.Text;
LenStr := Length(AuxStr);
if LenStr > 11 then
raise Exception.Create('Longitud Máxima de Variable es 11');
for i := 1 to LenStr do
if not (AuxStr[i] in ['0'..'9']) then
raise Exception.Create('Solo se Permiten Caracteres Númericos');
if LenStr < 11 then
AuxStr := Edit1.Text + StringOfChar('0', 11-LenStr);
ShowMessage(AuxStr);
end;
El código anterior en Delphi 7 sobre Windows 7 Professional x32,
permite rellenar con 0 a la derecha una cantidad numérica de máximo 11 dígitos y muestra el resultado.
Espero sea útil
Nelson.