Added util.getFormattedSize() (#3383)
This commit is contained in:
1 parent
ba6cc87424
commit
ecaeb4b6d7
2 files changed
+13
-1
No files matched your search
@@ -369,6 +369,16 @@ function util.getFriendlySize(size)
|
||||
return s
|
||||
end
|
||||
|
||||
--- Gets formatted size as string (1273334 => "1,273,334")
|
||||
---- @int size (bytes)
|
||||
---- @treturn string
|
||||
function util.getFormattedSize(size)
|
||||
local s = tostring(size)
|
||||
s = s:reverse():gsub("(%d%d%d)", "%1,")
|
||||
s = s:reverse():gsub("^,", "")
|
||||
return s
|
||||
end
|
||||
|
||||
--- Adds > to touch menu items with a submenu
|
||||
function util.getMenuText(item)
|
||||
local text
|
||||
|
||||
Reference in new issue
Block a user