mirror of
https://github.com/nushell/nushell.git
synced 2025-04-28 07:08:20 +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. |
||
---|---|---|
.. | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_nu_example | ||
nu_plugin_polars | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu_plugin_stress_internals | ||
nu-cli | ||
nu-cmd-base | ||
nu-cmd-extra | ||
nu-cmd-lang | ||
nu-cmd-plugin | ||
nu-color-config | ||
nu-command | ||
nu-derive-value | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-lsp | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-plugin-core | ||
nu-plugin-engine | ||
nu-plugin-protocol | ||
nu-plugin-test-support | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-std | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
nuon | ||
README.md |
Nushell core libraries and plugins
These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.
Foundational libraries are split into two kinds of crates:
- Core crates - those crates that work together to build the Nushell language engine
- Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.
Plugins are likewise also split into two types:
- Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
- Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.