File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 22
33<!-- prettier-ignore-start -->
44
5- [ ![ CI] ( https://github.com/bytesize-rs/bytesize/actions/workflows/ci.yml/badge.svg )] ( https://github.com/bytesize-rs/bytesize/actions/workflows/ci.yml )
6- [ ![ Crates.io Version] ( https://img.shields.io/crates/v/bytesize.svg )] ( https://crates.io/crates/bytesize )
5+ [ ![ crates.io] ( https://img.shields.io/crates/v/bytesize?label=latest )] ( https://crates.io/crates/bytesize )
6+ [ ![ Documentation] ( https://docs.rs/bytesize/badge.svg?version=2.0.0 )] ( https://docs.rs/bytesize/2.0.0 )
7+ ![ Version] ( https://img.shields.io/badge/rustc-1.75+-ab6000.svg )
8+ ![ Apache 2.0 licensed] ( https://img.shields.io/crates/l/bytesize.svg )
9+ <br />
10+ [ ![ Dependency Status] ( https://deps.rs/crate/bytesize/2.0.0/status.svg )] ( https://deps.rs/crate/bytesize/2.0.0 )
11+ [ ![ Download] ( https://img.shields.io/crates/d/bytesize.svg )] ( https://crates.io/crates/bytesize )
712
813<!-- prettier-ignore-end -->
914
@@ -34,8 +39,9 @@ Display as human-readable string.
3439``` rust
3540use bytesize :: ByteSize ;
3641
37- assert_eq! (" 482.4 GiB" , ByteSize :: gb (518 ). to_string_as (true ));
38- assert_eq! (" 518.0 GB" , ByteSize :: gb (518 ). to_string_as (false ));
42+ assert_eq! (" 518.0 GiB" , ByteSize :: gib (518 ). display (). iec (). to_string ());
43+ assert_eq! (" 556.2 GB" , ByteSize :: gib (518 ). display (). si (). to_string ());
44+ assert_eq! (" 518.0G" , ByteSize :: gib (518 ). display (). iec_short (). to_string ());
3945```
4046
4147Arithmetic operations are supported.
You can’t perform that action at this time.
0 commit comments