nushell/crates/nu-cmd-extra/src/extra/strings/format
Stefan Holderbach f91713b714
Add format duration to replace into duration --convert (#9788)
# Description
Add `format duration` cmd to choose output unit.

This takes the previous `into duration --convert ...` behavior which
returned a string into its own `format duration` command.
This was suprising and not fitting with the general type signature for
the `into ...` commands.

This command for now lives in the `nu-cmd-extra` nursery.

# User-Facing Changes
## Breaking change
Removes formatting behavior from `into duration`
Now use `format duration` instead of `into duration --convert`
## Usage:
```
1sec | format duration us # Output data in microseconds
"2ms" | into duration | format duration sec # go from string to string
```


# Tests + Formatting
Basic example testing (including basic broadcast)
2023-07-30 22:23:36 +02:00
..
command.rs REFACTOR: move the 0% commands to nu-cmd-extra (#9404) 2023-07-06 08:31:31 -07:00
duration.rs Add format duration to replace into duration --convert (#9788) 2023-07-30 22:23:36 +02:00
filesize.rs Fix signatures for cellpath access of records (#9793) 2023-07-26 23:13:57 +02:00
mod.rs Add format duration to replace into duration --convert (#9788) 2023-07-30 22:23:36 +02:00