Skip to content

Commit

Permalink
feat(memory): add bibytes1() units fn
Browse files Browse the repository at this point in the history
  • Loading branch information
graelo committed Feb 17, 2024
1 parent a4b1b3e commit 7e4e6fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ scale_fn!(mhz,
mantissa_fmt: "{:.0}",
unit: "MHz",
doc: "Return a string with the value and its si-scaled unit of MHz.");

// defines the `bibytes1()` function: 9.56 GB
scale_fn!(bibytes1,
base: B1024,
constraint: UnitAndAbove,
mantissa_fmt: "{:.1}",
unit: "B",
doc: "Return a string with the value and its si-scaled unit of bibytes.");

0 comments on commit 7e4e6fd

Please sign in to comment.