![]() |
Re: Einfaches Addieren klapt nicht!
Zitat:
Zitat:
Nun hab aber ich ein Problem beim FormatBytes wenn Total: int64; (und genauso wenn Totalsize: int64;):
Delphi-Quellcode:
Formatbytes(Total) ergibt immer noch 10,27MB (obwohl wie gesagt Total ohne format richtig is). Wie komm ich jetzt da raus?!
function FormatBytes(const Bytes : cardinal):string;
begin if Bytes < 1024 then begin Result := Format('%s', [IntToStr(Bytes)]) + ' B'; Exit; end; if (Bytes >= 1024) and (Bytes < (1024 * 1024)) then begin Result := Format('%n', [Bytes / 1024]) + ' KB'; Exit; end; if (Bytes >= (1024*1024)) and (Bytes < (1024 * 1024 * 1024)) then begin Result := Format('%n', [Bytes / (1024 * 1024)]) + ' MB'; Exit; end; if Bytes >= (1024*1024*1024) then begin Result := Format('%n', [Bytes / (1024 * 1024 * 1024)]) + ' GB'; Exit; end; end; |
Re: Einfaches Addieren klapt nicht!
Moin litsa,
Code:
wenn schon, dann auch überall ändern ;-)
function FormatBytes(const Bytes : [b][color=red]cardinal[/color][/b]):string;
|
Re: Einfaches Addieren klapt nicht!
Zitat:
Zitat:
Supi kann jetzt sagen bin ein glückliches Mädel da dies auch gelöst wurde!! Ich danke euch allen :) Gruß Evangelia |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:49 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