chore(onboarding): Replace parseUsersCount

This commit is contained in:
Marcus Kida 2022-12-29 07:51:12 +01:00
parent 6c260f942f
commit 66b6bcd0ef
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
1 changed files with 1 additions and 12 deletions

View File

@ -77,7 +77,7 @@ extension PickServerSection {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.12
let valueAttributedString = NSAttributedString(
string: parseUsersCount(server.totalUsers),
string: server.totalUsers.asAbbreviatedCountString(),
attributes: [
.paragraphStyle: paragraphStyle
]
@ -125,17 +125,6 @@ extension PickServerSection {
}
.store(in: &cell.disposeBag)
}
private static func parseUsersCount(_ usersCount: Int) -> String {
switch usersCount {
case 0..<1000:
return "\(usersCount)"
default:
let usersCountInThousand = Float(usersCount) / 1000.0
return String(format: "%.1fK", usersCountInThousand)
}
}
}
extension PickServerSection {