Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

number to byte-type

Posted on 2003-02-26
4
Medium Priority
?
167 Views
Last Modified: 2010-04-04
How can i chance a number to a byte type?
420000 to 420kB
2132000 to 2.132kB
...
0
Comment
Question by:Steve2000
  • 2
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8025968
thats not a type, thats a calculation

Function Bytes2KiloBytes(AByteValue : Integer) : Integer;
begin
  result := Trunc(AByteValue/1024);
end;

meikl ;-)

a chance you have allways :-))
0
 

Author Comment

by:Steve2000
ID: 8026373
I want my number like the 'Size' in Windows Explorer
0
 
LVL 5

Accepted Solution

by:
Lukasz Lach earned 80 total points
ID: 8026782
Format('%f KB', [Size/1024]);
or
Format('%f MB', [Size/1024/1024]);

:-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8026875
yep,

then use anakin's suggestion,
and of course grade him,
if this works for you

meikl ;-)
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This is an update to some code that someone else posted on Experts Exchange. It is an alternate approach, I think a little easier to use, & makes sure that things like the Task Bar will update.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question