human-memsize

Crates.iohuman-memsize
lib.rshuman-memsize
version0.1.0
created_at2025-09-03 08:30:08.032241+00
updated_at2025-09-03 08:30:08.032241+00
descriptionHuman-readable formatting for memory sizes
homepage
repositoryhttps://github.com/piot/human-memsize
max_upload_size
id1822164
size4,080
Peter Bjorklund (piot)

documentation

README

💾 human-memsize

Make your byte sizes human-friendly. Because 1045678 looks scary, but 1 MiB feels just right.

License: MIT


✨ Features

  • 🧩 Binary units — Uses KiB, MiB, GiB, TiB
  • 🎯 Smart formatting:
    • Shows bytes up to 2 KiB for clarity.
    • Uses no decimals for exact numbers → 2 MiB, not 2.0 MiB.
    • Uses one decimal when needed → 1.5 MiB.

🛠️ Usage

Add to your Cargo.toml:

[dependencies]
human-memsize = "0.1"

Copyright 2025 Peter Bjorklund. All rights reserved.

Commit count: 0

cargo fmt