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

m
(Parameters)
Line 6: Line 6:
  
 
== Parameters ==
 
== Parameters ==
<span style="display: inline-block; width: 50px;">'''N'''</span>The byte number that you wish to format.
 
  
<span style="display: inline-block; width: 50px;">'''b'''</span>Comma-formats the number for bytes.
+
* '''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))
 
+
* '''b''' - Comma-formats the number for bytes.
<span style="display: inline-block; width: 50px;">'''k'''</span>Comma, and decimal-formats the number for [[kilobytes]].
+
* '''k''' - Comma, and decimal-formats the number for [[kilobytes]].
 
+
* '''m''' - Comma, and decimal-formats the number for [[megabytes]].
<span style="display: inline-block; width: 50px;">'''m'''</span>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]].
<span style="display: inline-block; width: 50px;">'''g'''</span>Comma, and decimal-formats the number for [[gigabytes]].
+
* '''3''' - Returns the result in 3-digit format.
 
+
* '''d''' - Returns the value whilst retaining decimal point values.
<span style="display: inline-block; width: 50px;">'''t'''</span>Comma, and decimal-formats the number for [[terabytes]].
 
 
 
<span style="display: inline-block; width: 50px;">'''3'''</span>Returns the result in 3-digit format.
 
 
 
<span style="display: inline-block; width: 50px;">'''d'''</span>Returns the value whilst retaining decimal point values.
 
  
 
== Properties ==
 
== Properties ==

Revision as of 22:50, 12 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 'l' 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

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