Page 1 of 1

How to Format foldersize()?

Posted: 22 Nov 2015 06:34
by armsys
How to format the output(s) of foldersize() in "#,0" style?
Thank you.

Re: How to Format foldersize()?

Posted: 22 Nov 2015 23:57
by armsys
Is this possible?

Code: Select all

::text foldersize(,format(<d>, "#00000"));

Re: How to Format foldersize()?

Posted: 23 Nov 2015 03:26
by highend
no

format() formats the output of foldersize(), not the other way round...

Re: How to Format foldersize()?

Posted: 23 Nov 2015 06:33
by armsys

Code: Select all

::text format(foldersize(),"00000");
Not working! :naughty: Sorry! :oops:

Re: How to Format foldersize()?

Posted: 23 Nov 2015 08:23
by highend
::text format(foldersize(, "<r>"),"#0,0000");

Re: How to Format foldersize()?

Posted: 23 Nov 2015 08:58
by armsys
HI Highend,
Wow! Yours works brilliantly. Thanks a lot. :appl:
But how to apply format () to:

Code: Select all

::foldersize(,"<d>, <f>, <b>");

Re: How to Format foldersize()?

Posted: 23 Nov 2015 09:09
by highend

Code: Select all

    $properties = foldersize(,"<d>, <f>, <b>");
    $bytes      = gettoken($properties, 3, ", ");
    $bytes      = format(gettoken($bytes, 1, " "),"#0,0000") . " " . gettoken($bytes, 2, " ");
    text $bytes;

Re: How to Format foldersize()?

Posted: 23 Nov 2015 10:28
by armsys
Hi Highend,
Thanks to your tip, I modify the script for my learning exercise.
Thank for your help.

Code: Select all

 $properties = foldersize(,"<d>, <f>, <b>");
  $text    = "Folder Count: " . format(gettoken($properties, 1, ", "),"000") . <crlf>."File Count: " . format(gettoken($properties, 2, ", "),"#,000.00") . <crlf> .
   "Bytes: " . format(gettoken($properties, 3, " "),"#,0.0000") . gettoken($properties, 4, " ");
  text $text;