forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Convert @file(*,z) bytes into k or megabytes

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Jeffrey
Newbie


Joined: 08 May 2002
Posts: 1
Location: U.S.A. Arizona

PostPosted: Thu May 09, 2002 4:18 am    Post subject: Convert @file(*,z) bytes into k or megabytes Reply with quote

I am lost big time when it comes to math. Can anyone help me with this problem?

Thanks,
Jeffrey

_________________
Jeffrey
Back to top
View user's profile Send private message Send e-mail
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu May 09, 2002 4:41 am    Post subject: Reply with quote

For bytes to Kilobytes divide by 1024. For bytes to MB and so on just add 3 0's.
To round them off use @FORMAT():
Code:

%%Kilobytes = @FDIV(126287,1024)
%%Megabytes = @FDIV(12628778,1024000)
%%RoundedK = @FORMAT(@FDIV(126287,1024),0)
%%RoundedMB = @FORMAT(@FDIV(12628778,1024000),0)
info %%Kilobytes K@CR()%%Megabytes MB@CR()%%RoundedK K@CR()%%RoundedMB MB

*Note: I'm not sure if 1024000 is right for Megabytes but it's close..anybody correct me on that?*
Good luck.

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu May 09, 2002 6:47 am    Post subject: Reply with quote

kilobyte = 1024 bytes
megabyte = 1,048,576 bytes (1024 kilobytes)
gigabyte = 1,073,741,824 bytes (1024 megabytes)
terabyte = 1,099,511,627,776 bytes (1024 gigabytes)

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group