Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JosephTLyons/nu_plugin_units
https://github.com/JosephTLyons/nu_plugin_units
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/JosephTLyons/nu_plugin_units
- Owner: JosephTLyons
- License: mit
- Created: 2023-11-27T03:42:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-22T04:54:58.000Z (7 months ago)
- Last Synced: 2024-05-22T05:30:21.909Z (7 months ago)
- Language: Rust
- Size: 75.2 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nu - nu_plugin_units
README
# nu_plugin_units
A [Nushell](https://www.nushell.sh) plugin for easily converting between common units.
## Installation
1. Clone this repository
2. Build the target via `cargo build --release`
3. Add the plugin to nushell using the following nushell command `plugin add ./target/release/nu_plugin_units`
4. Reload the plugin using `plugin use units`## Usage
```shell
〉units -c time -u years -v 1
╭────┬──────────────┬────────────────────────╮
│ # │ unit │ value │
├────┼──────────────┼────────────────────────┤
│ 0 │ centuries │ 0.0100 │
│ 1 │ days │ 365.0000 │
│ 2 │ decades │ 0.1000 │
│ 3 │ hours │ 8760.0000 │
│ 4 │ microseconds │ 31540000000000.0000 │
│ 5 │ milliseconds │ 31556952000.0000 │
│ 6 │ minutes │ 525600.0000 │
│ 7 │ months │ 12.0000 │
│ 8 │ nanoseconds │ 31540000000000000.0000 │
│ 9 │ seconds │ 31536000.0000 │
│ 10 │ weeks │ 52.1430 │
│ 11 │ years │ 1.0000 │
╰────┴──────────────┴────────────────────────╯
```You may want to consider adjusting the value of `float_precision` in your nushell config file.
```nu
$env.config = {
float_precision: 4
...
}
```