Various fixes

This commit is contained in:
Ilya Laktyushin
2023-02-21 20:07:36 +04:00
parent 1e6c6d6091
commit f8ab3d037e
13 changed files with 107 additions and 59 deletions

View File

@@ -13,6 +13,9 @@ import AccountContext
public func autodownloadDataSizeString(_ size: Int64, decimalSeparator: String = ".") -> String {
if size >= 1024 * 1024 * 1024 {
var remainder = (size % (1024 * 1024 * 1024)) / (1024 * 1024 * 102)
if remainder == 10 {
remainder = 9
}
while remainder != 0 && remainder % 10 == 0 {
remainder /= 10
}
@@ -24,6 +27,9 @@ public func autodownloadDataSizeString(_ size: Int64, decimalSeparator: String =
}
} else if size >= 1024 * 1024 {
var remainder = (size % (1024 * 1024)) / (1024 * 102)
if remainder == 10 {
remainder = 9
}
while remainder != 0 && remainder % 10 == 0 {
remainder /= 10
}