Brian Dunning's FileMaker Custom Functions

ContainerSize ( Container ; Precision )

Get the size of your container

  Average rating: 4.2 (41 votes) Log in to vote

Robert Schaub   Robert Schaub
Starr Data
http://starrdata.com

Share on Facebook Share on Twitter

  Sample input:
ContainerSize (YourTable :: YourContainer ; 2 )

or

ContainerSize (YourTable :: YourContainer ; YourTable :: Your_PrecisionNumber )
  Sample output:
3.26 MB
9.26 KB
1.2 GB

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

This is my variation of the GetContainerSize command. See my sample at download page of my site. http://starrdata.com

 

Comments

kade   kade, Hamburg; Germany
Nov 30, 2009
1 KB = 1024 byte
1 MB = 1024 KB
1 GB = 1024 MB

I think this function works bad
 
Andrey Kolganov   Andrey Kolganov, Moscow
Aug 25, 2010
//i think this is correct variant
//
//ContainerSize ( Container ; Precision )
//Robert Schaub
//www.starrdata.com

Let ( [
CTainer = Length(Container)
; Roundit = Precision];

Case(
CTainer ≥ 1073741824;Round ( (CTainer / 1073741824); Roundit ) & " GB";
CTainer ≥ 1048576;Round ( (CTainer / 1048576); Roundit ) & " MB";
CTainer ≥ 1024;Round ( (CTainer / 1024); Roundit ) & " KB";""
) )
 
Andrey Kolganov   Andrey Kolganov, Moscow, Russia
Aug 25, 2010
P.S. ...because
1 KB = 1024 byte = 2^10 byte
1 MB = 1024 KB = 2^20 byte = 1048576 byte
1 GB = 1024 MB = 2^30 byte = 1073741824 byte
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: