()
| 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 | } |