UserLand Software Home  |  Manila  |  Radio  |  Support  |  News

DocServer

Prev | Next | String Verbs > string.megabyteString

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 (123456789)

   » "117.7MB"

string.megabyteString (4096)

   » 4K

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

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

Prev | Next | String Verbs > string.megabyteString

Anonymization by Anonymouse.org ~ Adverts
Anonymouse better ad-free, faster and with encryption?
X