![]() |
Tausender in einem "integer-string" mit Punkt kenn
Hallo nochmal :)
Ich bekomme aus einer Inputbox einen String, der rein aus einer zahl besteht, z.B. "1000000" (ohne "") Nun möchte ich , dass das Programm zur besseren Lesbarkeit die Tausender kennzeichnet, also dass das dann so aussieht: "1.000.000"(ohne "") . wie mache ich das am klügsten? |
Re: Tausender in einem "integer-string" mit Punkt
Delphi-Quellcode:
hab' ich von himitsu
aString := Format('%.0n',[aInteger / 1]);
meine alte manuelle Methode war:
Delphi-Quellcode:
function FormatInt(Int : Int64) : string;
var i : Integer; begin Result := IntToStr(Int); i := Length(Result) -3; while i > 0 do begin Insert(ThousandSeparator, Result, i+1); dec(i,3); end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:47 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz