Filemaker custom function that returns container size in bytes, kilobytes or megabytes with the corresponding abbreviation.
Format
GetContainerSize ( Container ; Precision )
Parameter
Container - any container expression or container field
Precision - number of decimal places, any numeric expression or field containing a numeric expression
Data type returned
text
Description
Returns size (always more than 1 if not empty) of Container in bytes, kilobytes or megabytes with the corresponding abbreviation (B, KB or MB), rounded to the specified number of decimal places.
Example 1
Input:
GetContainerSize ( Files::file1 ; 0)
Output:
213 B
Example 2
Input:
GetContainerSize ( Files::file2 ; 1)
Output:
72.6 KB
Example 3
Input:
GetContainerSize ( Files::file3 ; 2)
Output:
5.63 MB
Let (
cSize = Length ( Container );
Case(
cSize ≥ 1048576; Round ( cSize/1048576 ; Precision ) & " MB";
cSize ≥ 1024; Round ( cSize/1024 ; Precision ) & " KB";
cSize > 0; cSize & " B";
)
)