|
-
Aug 23rd, 2000, 05:10 PM
#1
Thread Starter
Hyperactive Member
Does anyone know the conversion of KB to mb? thanks
Matt 
-
Aug 23rd, 2000, 05:14 PM
#2
Frenzied Member
1024Kb in an Mb
so to convert multiply the number of Mb to get the no of Kb
Divide the number of Kb by 1024 to get the number of Mb
-
Aug 23rd, 2000, 05:17 PM
#3
Frenzied Member
If you want to quickly convert Bytes into KB/MB/GB use this code from Vbworld
Code:
Private Declare Function StrFormatByteSize Lib _
"shlwapi" Alias "StrFormatByteSizeA" (ByVal _
dw As Long, ByVal pszBuf As String, ByRef _
cchBuf As Long) As String
Public Function FormatKB(ByVal Amount As Long) _
As String
Dim Buffer As String
Dim Result As String
Buffer = Space$(255)
Result = StrFormatByteSize(Amount, Buffer, _
Len(Buffer))
If InStr(Result, vbNullChar) > 1 Then
FormatKB = Left$(Result, InStr(Result, _
vbNullChar) - 1)
End If
End Function
Use it like
Newvar = FormatKB(OldVar)
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Aug 23rd, 2000, 05:21 PM
#4
Here is an example of what Sam Finch said,
Code:
FS = FileLen("C:\autoexec.bat") / 1024 'returns 0.5107421875
'If you want to have no decimal, change the / to \
Msgbox FS
-
Aug 23rd, 2000, 05:24 PM
#5
Thread Starter
Hyperactive Member
great!
Thanks everyone it works great!
Matt 
-
Aug 23rd, 2000, 05:39 PM
#6
Hyperactive Member
be careful
there is an SI version(decimal) and a binary version
SI is one kilobyte is 1,000 bytes
SI is one meg is 1,000 Kb or 1,000,000bytes
SI is one gig is 1,000,000,000 bytes
binary is traditionaly written KiB or MiB or GiB
one KiB is 1024 bytes
one MiB is 1024 KiB
one GiB is 1024 MiB
the problem is what are some utility programs using.
older comuter programs typically use binary but not allways.
This is why marketing is such a big department.
6 GiB is 6.4Gb in SI units Which are you going to buy?
I always like the SI standards but I take exception here. I think that the binary unit is needed simply because of the nature of the computer.
I think money talks, and SI walks
I am so skeptical, I can hardly believe it!
PS I am not a 'hyperactive member' I am a cool, calm, and collected member 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|