Re: Memory output format



Rick wrote:

I'm trying to format a string in a VB Script for amount of memory I am
getting from a server. the string is 1073197056, I need to have it show
as a readable number, say 1 gig, I also will have the problem for
systems with 512 and 2 gig etc. Is there a conversion I can do on these
numbers

You can display the number with commas, which makes it much easier to read,
with the FormatNumber function:

lngValue = 1073197056
Wscript.Echo FormatNumber(lngValue, 0)

You can also convert bytes to gigabytes by dividing by 2^30 (1,073,741,824).

Wscript.Echo FormatNumber(lngValue/2^30, 3)

The second parameter in the FormatNumber function is the number of digits to
display after the decimal.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net


.



Relevant Pages

  • Re: Windows 2000 server hacked
    ... I did change the files to display both hidden and system files. ... but the swap file is on the other drives and ... the data on this drive was around 1.5 gig for well over a year. ... > "Rick Totedo" wrote in message ...
    (microsoft.public.security)
  • Re: E-string breakage
    ... > I'm getting a little tired of having my high E break at a gig. ... > 18 gauge D'Addarios for the high E and B. Yes, the Taylor handles it ... > E it breaks after a couple dozen tuning changes. ... Make sure it's not so deep that the string is ...
    (rec.music.makers.guitar.acoustic)
  • Re: Lets argue
    ... >> I think that you're thinking of a locking nut, not locking tuners. ... >> Locking tuners basically allow you to stick the string thru the peg, ... string at a gig. ... I don't sweat the broken string thing much and haven't taken a spare guitar ...
    (rec.music.makers.guitar)
  • Re: S: Notebook
    ... 50 Gig HDD ... ATI Mobility Radeon HD 3470 ... Oh, ich sehe grade, das hat ein 17" Display. ...
    (de.comp.sys.notebooks)
  • Windows Explorer Slow
    ... display the disk tree it will display and seems to reset and try to ... I don't know if this is going to be of some help, but I have a 60 gig ... the music partition "M" the yellow folder icon is ...
    (microsoft.public.windowsxp.perform_maintain)