How to Format foldersize()?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

How to Format foldersize()?

Post by armsys »

How to format the output(s) of foldersize() in "#,0" style?
Thank you.

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: How to Format foldersize()?

Post by armsys »

Is this possible?

Code: Select all

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

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to Format foldersize()?

Post by highend »

no

format() formats the output of foldersize(), not the other way round...
One of my scripts helped you out? Please donate via Paypal

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: How to Format foldersize()?

Post by armsys »

Code: Select all

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

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to Format foldersize()?

Post by highend »

::text format(foldersize(, "<r>"),"#0,0000");
One of my scripts helped you out? Please donate via Paypal

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: How to Format foldersize()?

Post 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>");

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: How to Format foldersize()?

Post 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;
One of my scripts helped you out? Please donate via Paypal

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: How to Format foldersize()?

Post 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;

Post Reply