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?
((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”)