docServerUserLandCom picture
Contents
Frontier Site

string.megabyteString

Syntax string.megabyteString (number)

Params number is a numeric value you wish to convert to megabytes.

Action Converts number to megabytes by dividing it by (1024*1024) and appending "MB" to the end.

Returns The resulting reformatted and calculated number in the form nMB, where n is number rounded to one decimal place with "MB" appended.

Examples string.megabyteString (4096)

   » 4K

Note that if the number of bytes is less than one megabye, the output is in MB.

string.megabyteString (memAvail ())

   » "77.8MB"

memAvail is a basic verb which tells how much memory is available in the system.

string.megabyteString (file.size (Frontier.getFilePath ()))

   » "3.3MB"

file.size is a Frontier verb that determines the size of a file in bytes.

Notes This verb is implemented as a script.

This verb is new in Frontier 5.0.

See Also string.KBytes


© Copyright 1992-2026 UserLand Software. Email: webmaster@userland.com.