mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-23 08:17:34 -04:00
parallel resource downloading
This commit is contained in:
parent
fb587a6d30
commit
fe5244d458
11 changed files with 116 additions and 40 deletions
|
@ -16,3 +16,14 @@ static func to_alpha(text: String) -> String:
|
|||
|
||||
result = result.strip_edges()
|
||||
return result
|
||||
|
||||
|
||||
static func bytes_to_string(bytes: int) -> String:
|
||||
if bytes < 1024: return str(bytes) + "B"
|
||||
|
||||
var kb = bytes / 1024
|
||||
if kb < 1024: return str(kb) + "KB"
|
||||
|
||||
var mb = kb / 1024.0
|
||||
var text = "%.1fMB" if mb < 10.0 else "%.0fMB"
|
||||
return text % [mb]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue