Sum of Sizes of Descendants of Folder AS MB

(imported topic written by thesurg3on91)

Hi,

What does sum of sizes of descendants of folder report back as? Bytes? KB. I want to get the formatting correct so that a report shows as KB, MB, or GB depending on the size.

if exists folder “C:\temp” then ((sum of sizes of descendants of folder (“C:\temp”) /1024/1024))as string else “Missing Folder”

Is this correct? How can add a bit more elegance and look write MB or GB or KB depending on size?

(imported comment written by NoahSalzman)

You could do something like this. This replaces

((sum of sizes of descendants of folder (“C:\temp”) /1024/1024))

(if (it > 102412041024) then ((it / 1024/1024/1024) as string & “GB”) else if (it > 1024*1024) then ((it / 1024/1024) & “MB” as string) else if (it > 1024) then ((it / 1024) as string & “KB”) else it as string) of (sum of sizes of descendants of folder “C:\temp”)