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

(Properties)
(Parameters)
Line 7: Line 7:
 
== Parameters ==
 
== Parameters ==
  
* '''N''' - The byte number that you wish to format. You can use the letter 'e' or 'l' as *10^N, $bytes(5e6) = $bytes($calc(5*10^6))
+
* '''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.
 
* '''b''' - Comma-formats the number for bytes.
 
* '''k''' - Comma, and decimal-formats the number for [[kilobytes]].
 
* '''k''' - Comma, and decimal-formats the number for [[kilobytes]].

Revision as of 20:40, 13 August 2018

$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.

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