console-rs / indicatif

A command line progress reporting library for Rust
MIT License
4.22k stars 238 forks source link

Add `decimal_bytes_per_sec` state formatter #550

Closed Hirevo closed 11 months ago

Hirevo commented 1 year ago

This PR simply adds a decimal_bytes_per_sec state formatter.

Since bytes_per_sec and binary_bytes_per_sec are both formatted using power-of-two units, it felt like a decimal_bytes_per_sec formatter (for using SI units) was missing.

This follows in the same spirit as the bytes and total_bytes formatters, which both have binary and decimal variants.

This PR also updates the docs to mention these binary and decimal variants being available, which were missing even for bytes and total_bytes.

djc commented 1 year ago

I'm not that inclined to merge more formatters, given that we now have an extension point for this in the ProgressTracker trait.