AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Byte in Mega- und Kilobyte umwandeln

Ein Thema von tobias2207 · begonnen am 8. Mai 2005 · letzter Beitrag vom 8. Mai 2005
Antwort Antwort
Benutzerbild von mirage228
mirage228

Registriert seit: 23. Mär 2003
Ort: Münster
3.750 Beiträge
 
Delphi 2010 Professional
 
#1

Re: Byte in Mega- und Kilobyte umwandeln

  Alt 8. Mai 2005, 15:36
Ich werfe mal diese Funktion in den Raum:

Delphi-Quellcode:
// by Luckie
function FormatDiskSpace(DiskSpace: Int64): string;
begin
  case DiskSpace of
    0..1023: Result := Format('%d Byte', [DiskSpace]);
    1024..1048575: Result := Format('%2n KB', [DiskSpace / 1024]);
    1048576..1073741823: Result := Format('%2n MB', [DiskSpace / 1024 / 1024]);
  else
    Result := Format('%2n GB', [DiskSpace / 1024 / 1024 / 1024]);
  end;
end;
mfG
mirage228
David F.

May the source be with you, stranger.
PHP Inspection Unit (Delphi-Unit zum Analysieren von PHP Code)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:32 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