|
@@ -4,14 +4,20 @@ Format bytes to string
|
|
|
|
|
|
|
|
## Installation
|
|
## Installation
|
|
|
|
|
|
|
|
-```go get github.com/labstack/gommon/bytes```
|
|
|
|
|
|
|
+```go
|
|
|
|
|
+go get github.com/labstack/gommon/bytes
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
## [Usage](https://github.com/labstack/gommon/blob/master/bytes/bytes_test.go)
|
|
## [Usage](https://github.com/labstack/gommon/blob/master/bytes/bytes_test.go)
|
|
|
|
|
|
|
|
|
|
+```sh
|
|
|
|
|
+import gytes github.com/labstack/gommon/bytes
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
### Decimal prefix
|
|
### Decimal prefix
|
|
|
|
|
|
|
|
```go
|
|
```go
|
|
|
-fmt.Println(bytes.Format(1323))
|
|
|
|
|
|
|
+fmt.Println(gytes.Format(1323))
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
`1.32 KB`
|
|
`1.32 KB`
|
|
@@ -19,7 +25,7 @@ fmt.Println(bytes.Format(1323))
|
|
|
### Binary prefix
|
|
### Binary prefix
|
|
|
|
|
|
|
|
```go
|
|
```go
|
|
|
-fmt.Println(bytes.FormatB(1323))
|
|
|
|
|
|
|
+fmt.Println(gytes.FormatB(1323))
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
`1.29 KiB`
|
|
`1.29 KiB`
|