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
| function APlusGranQueB(A,B:string)
var pA,pB:integer;
begin
result:=false;
pA:=Pos(',',A);
if pA=0 then begin//S'assure qu'il y ait le séparateur décimal dans chaque chaine
A:=A+',';
pA:=length(A);
end;
pB:=Pos(',',B);
if pB=0 then begin//S'assure qu'il y ait le séparateur décimal dans chaque chaine
B:=B+',';
pB:=length(B);
end;
if pA>pB then begin
result:=true;
exit;
end;
if pB>pA then exit;
A:=A+StringOfChar('0',max(0,Length(B)-length(A));//Formate les nombres pour avoir la même longueur
B:=B+StringOfChar('0',max(0,Length(A)-length(B));
if A>B then begin
result:=true;
exit;
end;
end; |
Partager