Skip to content

Unit for representing and converting between file sizes, inspired by kotlin.time.Duration

License

Notifications You must be signed in to change notification settings

saket/file-size

Repository files navigation

file-size

implementation "me.saket.filesize:filesize:1.2.0"
val cacheSize = 512.megabytes
println(cacheSize.toString())          // "512 MB"
println(cacheSize.inWholeBytes)        // "512000000"
println(cacheSize + 88_000.kilobytes)  // "600 MB"
println(cacheSize * 2)                 // "1.02 GB"
println(cacheSize < 1.gigabytes)       // "true"

About

Unit for representing and converting between file sizes, inspired by kotlin.time.Duration

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages