From WikiChip
Difference between revisions of "mirc/identifiers/$bytes"
m |
(→Parameters) |
||
Line 6: | Line 6: | ||
== 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)) | |
− | + | * '''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 == | == Properties == |
Revision as of 21:50, 12 August 2018
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$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
mIRC identifier list