summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/String.xml14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 03bc2095c0..cf152e716e 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -437,6 +437,20 @@
[/codeblock]
</description>
</method>
+ <method name="humanize_size">
+ <return type="String">
+ </return>
+ <argument index="0" name="size" type="int">
+ </argument>
+ <description>
+ Converts [code]size[/code] represented as number of bytes to human-readable format using internationalized set of data size units, namely: B, KiB, MiB, GiB, TiB, PiB, EiB. Note that the next smallest unit is picked automatically to hold at most 1024 units.
+ [codeblock]
+ var bytes = 133790307
+ var size = String.humanize_size(bytes)
+ print(size) # prints "127.5 MiB"
+ [/codeblock]
+ </description>
+ </method>
<method name="insert">
<return type="String">
</return>