From WikiChip
Difference between revisions of "mirc/identifiers/$bytes"
< mirc‎ | identifiers

(Parameters)
Line 15: Line 15:
 
* '''3''' - Returns the result in 3-digit format.
 
* '''3''' - Returns the result in 3-digit format.
 
* '''d''' - Returns the value whilst retaining decimal point values.
 
* '''d''' - Returns the value whilst retaining decimal point values.
 +
 +
'''Note''': if you do not pass any of the bkmgt letter-switches, $bytes will smartly choose the unit, e.g displaying 1KB for 1024 bytes
  
 
== Properties ==
 
== Properties ==

Revision as of 18:58, 19 July 2019

$bytes allows you to format any number that you pass into various byte forms.


Synopsis

$bytes(<N>[,bkmgt3d])[.suf]

Parameters

  • N - The byte number that you wish to format. You can use the letter 'e' or 'd' as *10^N, $bytes(5e6) = $bytes($calc(5*10^6))
  • b - Comma-formats the number for bytes.
  • k - Comma, and decimal-formats the number for kilobytes.
  • m - Comma, and decimal-formats the number for megabytes.
  • g - Comma, and decimal-formats the number for gigabytes.
  • t - Comma, and decimal-formats the number for terabytes.
  • 3 - Returns the result in 3-digit format.
  • d - Returns the value whilst retaining decimal point values.

Note: if you do not pass any of the bkmgt letter-switches, $bytes will smartly choose the unit, e.g displaying 1KB for 1024 bytes

Properties

  • .suf - Returns the formatted bytes with the proper suffixes, which are: B, KB, MB, GB, and TB

Examples

Echo a large number with comma format to the active window

//echo -a $bytes(317889213,b)

Echo a byte value of GB to the active window with the suffix

//echo -a $bytes(10000000000,g).suf

Compatibility

Added: mIRC v6.17
Added on: 17 Feb 2006
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See Also

[Expand]
v · d · e mIRC identifier list