Skip to content

Commit

Permalink
docs: add format_bytes/to_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
linux-china committed Mar 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 34090f4 commit bda96f9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions info/stdlib.md
Original file line number Diff line number Diff line change
@@ -156,6 +156,13 @@ quote/double text if not quoted/double quoted.
- `quote("hello world") # 'hello world'`
- `double_quote("hello world") # "hello world"`

### format_bytes/to_bytes

Convert bytes to human-readable format, and vice versa. Units: `B`, `KB`, `MB`, `GB`, `TB`, `PB`, `EB`, `ZB`, `YB`.

- `format_bytes(1024)`: 1 KB
- `to_bytes("2 KB")`: 2024

# Text Escape

- escape: `escape("format", $1)`: support `json`, `csv`, `tsv`, `xml`, `html`, `sql`, `shell`

0 comments on commit bda96f9

Please sign in to comment.