From WikiChip
Difference between revisions of "mirc/identifiers/$bytes"
m (bot: correcting title) |
|||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{mirc title|$bytes Identifier}}'''$bytes''' allows you to format any number that you pass into various byte forms. | {{mirc title|$bytes Identifier}}'''$bytes''' allows you to format any number that you pass into various byte forms. | ||
+ | |||
== Synopsis == | == Synopsis == | ||
Line 5: | Line 6: | ||
== Parameters == | == 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 == | == Properties == | ||
− | + | * '''.suf''' - Returns the formatted bytes with the proper suffixes, which are: '''B''', '''KB''', '''MB''', '''GB''', and '''TB''' | |
== Examples == | == Examples == | ||
Line 40: | Line 37: | ||
{{mIRC identifier list}} | {{mIRC identifier list}} | ||
− | [[Category: | + | [[Category:mIRC identifiers|bytes]] |
Revision as of 18:58, 19 July 2019
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 '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
mIRC identifier list