mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: shorten unit names and add more units to ya.readable_size
This commit is contained in:
parent
a9ce714571
commit
c02d69590b
1 changed files with 2 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ end
|
|||
function ya.basename(str) return string.gsub(str, "(.*[/\\])(.*)", "%2") end
|
||||
|
||||
function ya.readable_size(size)
|
||||
local units = { "B", "KB", "MB", "GB", "TB", "PB", "EB" }
|
||||
local units = { "B", "K", "M", "G", "T", "P", "E", "Z", "Y", "R", "Q" }
|
||||
local i = 1
|
||||
while size > 1024.0 and i < #units do
|
||||
size = size / 1024.0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue