File: README.md

package info (click to toggle)
rust-pretty-bytes 0.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 100 kB
  • sloc: makefile: 4
file content (30 lines) | stat: -rw-r--r-- 586 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# rust-pretty-bytes [![Circle CI](https://img.shields.io/circleci/project/banyan/rust-pretty-bytes.svg)](https://circleci.com/gh/banyan/rust-pretty-bytes)

>Convert bytes to a human readable string: 1337 → 1.34 kB

Useful for displaying file sizes for humans, Ported from [sindresorhus/pretty-bytes](https://github.com/sindresorhus/pretty-bytes)

## Usage

### CLI

```shell
$ pretty-bytes 1337
1.34 kB

$ echo 1337 | pretty-bytes
1.34 kB
```

### API

```rust
extern crate pretty_bytes;
use pretty_bytes::converter::convert;

println!("{}", convert(1337_f64));
```

### License

MIT