VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

FormatFileSize

Jeff Cockayne  (2 Submissions)   String Manipulation   Visual Basic 3.0   Beginner   Wed 3rd February 2021

FormatFileSize: Formats a file's size in bytes into X GB or X MB or X KB or X bytes depending on size (a la Win9x Properties tab)
* UPDATED Sept. 12, 2000 * to allow for overriding the default Format Mask.

Inputs
dblFileSize: Double; File size in bytes Optionally, pass a standard format string (e.g.: "###.##") in strFormatMask if you need to override the default formatting

Assumes
Example: "FormatFileSize(100)" will return "100 bytes" "FormatFileSize(5500)" will return "5.4 KB" "FormatFileSize(15000000)" will return "14.31 MB"

Returns
String

Side Effects
None.

Rate FormatFileSize (3(3 Vote))
FormatFileSize.bas

FormatFileSize Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters