string.NiceSize

From GMod Wiki

Jump to: navigation, search
Function
Syntax string.NiceSize( Number number )
Where is this used?
Description:
Converts a number to a easy to read amount of bytes.
Returns: String
Part of Library: String
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=String.NiceSize]String.NiceSize [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionPrints the readable form of 9876543210, 567890, and 10 in bytes to the console
Used onNewerShared.png
Code
print(string.NiceSize(9876543210))
print(string.NiceSize(567890))
print(string.NiceSize(10))
Output
9.2 GB 
554.58 KB
10 Bytes


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox