https://kotlinlang.org logo
d

darkmoon_uk

01/02/2022, 11:06 AM
Anyone aware of a Multiplatform library to format (human readable) data sizes e.g.
17238
 → 
17.24 kB
? Must include JS. Used Package Search but nothing came up 🤷
I served my JS need by using this npm package and wrapping with:
Copy code
@JsModule("@tsmx/human-readable")
@JsNonModule
external object HumanReadable {
    fun fromBytes(byteCount: Long): String
}
j

jw

01/02/2022, 1:52 PM
This is like a 10-line function so you could always write it yourself
☝️ 1
d

darkmoon_uk

01/03/2022, 11:21 AM
2 Views