Skip to content

Commit fc6670f

Browse files
committed
Integrate .number.notation(.compactName)
1 parent 74bde46 commit fc6670f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

WordPress/Classes/ViewRelated/Reader/ReaderPostCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ private func makeButton(systemImage: String, font: UIFont = UIFont.preferredFont
385385
}
386386

387387
private func kFormatted(_ count: Int) -> String {
388-
count >= 1000 ? String(format: "%.0fK", Double(count) / 1000) : String(count)
388+
count.formatted(.number.notation(.compactName))
389389
}
390390

391391
// MARK: - ReaderPostCellView (Accessibility)

WordPress/Classes/ViewRelated/Reader/Subscriptions/ReaderSubscriptionCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ private enum Strings {
110110
}
111111

112112
private static func kFormatted(_ count: Int) -> String {
113-
count >= 1000 ? String(format: "%.0fK", Double(count) / 1000) : String(count)
113+
count.formatted(.number.notation(.compactName))
114114
}
115115
}

0 commit comments

Comments
 (0)