byteSizeToString()
Converts a filesize in bytes to a string (for example, with getFileSize()).
Synopsis
string byteSizeToString(float fByteSize);
Parameters
Parameter | Bedeutung |
---|---|
fByteSize | Size of a file in bytes |
Return Value
Errors
Description
The function converts a filesize in bytes to a string. The string shows the following format: '887 Byte', '4.76 KB', '12.8 MB', '1.78 GB'. The limit of ther function is MAX_FLOAT ( = 3.4*10^-38 Byte).
Example
main()
{
float x;
string y;
x = 34535;
y = byteSizeToString(x);
DebugN(y);
// Debug ['33,7 KB']
}
Assignment
File function
Availability
CTRL