Joe Strazzere - All Things Quality

Visit my new blog at http://strazzere.blogspot.com/


December 1, 2005 - WinTask - StrFormatByteSize

Posted in WinTask

'
' StrFormatByteSize - format a number nicely
'

' Author: Joe Strazzere
'

' returns one of the following formats as appropriate:
'
'  nnn bytes
'  nnn KB
'  nnn MB
'  nnn GB
'

' "shlwapi" Alias "StrFormatByteSizeA" (ByVal _
' dw As Long, ByVal pszBuf As String, ByRef _
' cchBuf As Long) As String

 

dim ptr as unsigned

ptr=allocate(32)

pokestring(ptr,"                                ",1)

qtyin=1000000000

 

External("shlwapi", "StrFormatByteSizeA",qtyin, ptr, 32)

 

var$=peekstring$(ptr)

 

msgbox(var$)


<- Last Page :: Next Page ->

About Me

A gathering place for information and ideas about Quality Assurance, Testing, and other useful topics.

Problems cannot be solved by the same level of thinking that created them. - A. Einstein

Search This Site

Translate This Site

RSS Feed

Subscribe

Twitter

@jstrazzere

Categories

Life
QA
Sports
Tools
WinTask
Work in General

What I'm Reading Now