1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
function Virement(Nccp : String;Montant: Real;Nom:String) : String;
var s,St,sNccp : String;MEntier : integer;
begin
s:= FormatFloat('0.00',Montant );;
s := copy(s,pos(DecimalSeparator,s)+1,2);
MEntier := trunc(Montant);
St := '*00000000' + Repeatstr('0',12-Length( epurer(Trim(Nccp)))) + epurer(Trim(Nccp));
St := St + RepeatStr('0',11-length(inttostr(mentier))) + IntToStr(MEntier)+ s;
if Length(Trim(Nom)) >= 27 then St := St + LeftStr(Trim(Nom),27)+'1'
Else St := St + nom + RepeatStr(' ',27-length(trim(nom))) + '1';
Result := st;
end;
function epurer (CCp : String):string;
Var s,s1 : string; i:integer;
Begin
s := '';
for i :=1 to length(ccp) Do
IF (CCp[i] in ['0'..'9']) Then S := S + CCp[i] ;
epurer := S;
end;
(**********************************************************************)
FUNCTION RepeatStr(ch: char; n:integer): string;
var i : integer ;
s : string;
Begin
s := '';
for i := 1 to n do s := s + ch;
result := s;
end; |
Partager