"Je te laisse faire le formattage du texte de la 1ère colonne pour avoir la 2ème alignées mais StringOfChar devrait faire l'affaire".
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question« en sachant bien sur que mon champ est de type décimale »
var TSL : TStringList; begin TSL := TStringList.Create; try for X := 0 to ... do TSL.Add('"'+Field[0].asString+'","'+Field[1].asString+'"'); TSL.SaveToFile(...); finally TSL.Free; end; end;
D := Format('%.2f', [24570.4]); // affiche 24570.40
procedure TForm1.Button20Click(Sender: TObject); var TSL: TStringList; i: integer; begin begin TSL := TStringList.Create; with query1 do try // for i := 0 to fields.Count - 1 do TSL.Add('"' + Fields[0].asString + '","' + Fields[1].asString + '"'); TSL.SaveToFile('test'); finally TSL.Free; end; end; end;
function TFAffaire.Arrondir2(VARIAD: Currency): currency; var Point: Integer; VARIAT, DEC3: string; begin VARIAT := FloatToStr(VARIAD); Point := PosEx(',', VARIAT); if Point <> 0 then begin DEC3 := copy(VARIAT, Point + 3, 1); if DEC3 = '' then begin Result := StrToCurr(VARIAT); exit; end; if (StrToInt(DEC3) >= 0) and (StrToInt(DEC3) <= 4) then Result := StrToCurr(copy(VARIAT, 1, Point + 2)) else if VARIAD > 0 then Result := StrToCurr(copy(VARIAT, 1, Point + 2)) + 0.01 else Result := StrToCurr(copy(VARIAT, 1, Point + 2)) - 0.01; end else Result := StrToCurr(VARIAT); end;