diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-04 16:05:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-04 16:05:03 +0200 |
commit | 11bbe152a9c0404c74cf17a79075932e59349ba6 (patch) | |
tree | 2dc6443feb51d8076b3f8e9003e4ddd457c13a25 /doc/classes/String.xml | |
parent | ee611d149b4b126e7edc4754f87953e3c3fd8c98 (diff) | |
parent | a0d00c0e99aaf7844a330c8e320c0021abb4a3e3 (diff) |
Merge pull request #32546 from Xrayez/bind-string-humanize-size
Bind the `String::humanize_size` method
Diffstat (limited to 'doc/classes/String.xml')
-rw-r--r-- | doc/classes/String.xml | 14 |
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> |