Skip to content

Commit 00ae5aa

Browse files
committed
docs: update readme
1 parent a17c093 commit 00ae5aa

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
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
3540
use 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

4147
Arithmetic operations are supported.

0 commit comments

Comments
 (0)