From 7e4e6fdfc302f685946969b3bc8c1a855212abd3 Mon Sep 17 00:00:00 2001 From: graelo Date: Sat, 17 Feb 2024 09:43:19 +0100 Subject: [PATCH] feat(memory): add bibytes1() units fn --- src/units.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/units.rs b/src/units.rs index c65ff74..38591c6 100644 --- a/src/units.rs +++ b/src/units.rs @@ -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.");