mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-20 02:58:45 +00:00
Consistently format byte sizes.
This commit is contained in:
@@ -76,7 +76,8 @@ class ByteSize(val bytes: Long) {
|
||||
}
|
||||
}
|
||||
|
||||
fun toUnitString(maxPlaces: Int = 1, spaced: Boolean = true): String {
|
||||
@JvmOverloads
|
||||
fun toUnitString(maxPlaces: Int = 2, spaced: Boolean = true): String {
|
||||
val (size, unit) = getLargestNonZeroValue()
|
||||
|
||||
val formatter = NumberFormat.getInstance().apply {
|
||||
|
||||
Reference in New Issue
Block a user