mirror of
https://github.com/nushell/nushell.git
synced 2025-04-26 06:08:21 +02:00
Issue #9887 which can be closed after this is merged. # Description This allows the "into duration" command to accept floats as inputs. Examples: <img width="767" alt="image" src="https://github.com/user-attachments/assets/da181f2a-7ad6-4efb-a6db-f9c6d8929c71" /> <img width="710" alt="image" src="https://github.com/user-attachments/assets/78623a39-33ad-42a0-9324-a147be86f95c" /> **How it works:** Using strings, like `"1.234sec" | into duration`, is already working, so if a user inputs `1.234 | into duration --sec`, I just convert this back to a string and use the previous conversion functions. **Limitations:** there are some limitation to using floats, but it's a general limitation that is already present for other use cases: - only 3 digits are taken into account in the decimal part - floating durations in nano seconds are always floored and not rounded <img width="761" alt="image" src="https://github.com/user-attachments/assets/a9076aab-da03-43f2-927c-c9703fc4f955" /> # User-Facing Changes Users can inject floats with `into duration` # Tests + Formatting cargo fmt and clippy OK Tests OK # After Submitting The example I added will automatically become part of the doc, I think that's enough for documentation. |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml | ||
LICENSE | ||
README.md |
This crate contains the majority of our commands
We allow ourselves to move some of the commands in nu-command
to nu-cmd-*
crates as needed.
Internal Nushell crate
This crate implements components of Nushell and is not designed to support plugin authors or other users directly.