File: README.md

package info (click to toggle)
golang-github-labstack-gommon 0.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 172 kB
  • sloc: makefile: 2
file content (29 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (2)
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
# Bytes

- Format bytes integer to human readable bytes string.
- Parse human readable bytes string to bytes integer.

## Installation

```go
go get github.com/labstack/gommon/bytes
```

## [Usage](https://github.com/labstack/gommon/blob/master/bytes/bytes_test.go)

### Format

```go
println(bytes.Format(13231323))
```

`12.62MB`

### Parse

```go
b, _ = Parse("2M")
println(b)
```

`2097152`