MCPcopy Create free account
hub / github.com/bytesize-rs/bytesize / precision

Function precision

src/display.rs:369–374  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367
368 #[test]
369 fn precision() {
370 let size = ByteSize::mib(1908);
371 assert_eq!("1.9 GiB".to_string(), format!("{size}"));
372 assert_eq!("2 GiB".to_string(), format!("{size:.0}"));
373 assert_eq!("1.86328 GiB".to_string(), format!("{size:.5}"));
374 }
375}

Callers

nothing calls this directly

Calls 1

mibFunction · 0.85

Tested by

no test coverage detected