string.KBytes

Syntax string.KBytes (number)

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

Action Converts number to kilobytes by dividing it by 1024, rounding the result up to the next K, and appending the character "K" to the end.

Returns The resulting reformatted and calculated number in the form nK, where n is number rounded up to the nearest K with the character "K" appended.

Examples string.KBytes (4096)

   » 4K

string.KBytes (4097)

   » 5K

Note rounding up to 5K because the number exceeds 4K by one byte.

string.KBytes (memAvail ())

   » "295K"

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

string.KBytes (file.size ("Diskovery:System Folder:System"))

   » "2096K"

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

Notes This verb is implemented as a script.

In most cases, string.megabyteString can be used as a replacement for this verb.

See Also string.megabyteString

Discuss