diff --git a/crates/nu-cli/src/cli.rs b/crates/nu-cli/src/cli.rs index 30ee65903f..24d1ed9fde 100644 --- a/crates/nu-cli/src/cli.rs +++ b/crates/nu-cli/src/cli.rs @@ -292,7 +292,7 @@ pub fn create_default_context( whole_stream_command(Trim), whole_stream_command(Echo), whole_stream_command(Str), - whole_stream_command(StrToFloat), + whole_stream_command(StrToDecimal), whole_stream_command(StrToInteger), whole_stream_command(StrDowncase), whole_stream_command(StrUpcase), diff --git a/crates/nu-cli/src/commands.rs b/crates/nu-cli/src/commands.rs index 71bdea9e6f..87b8e8834b 100644 --- a/crates/nu-cli/src/commands.rs +++ b/crates/nu-cli/src/commands.rs @@ -230,7 +230,7 @@ pub(crate) use split::SplitRow; pub(crate) use split_by::SplitBy; pub(crate) use str_::{ Str, StrCapitalize, StrDowncase, StrFindReplace, StrSet, StrSubstring, StrToDatetime, - StrToFloat, StrToInteger, StrTrim, StrUpcase, + StrToDecimal, StrToInteger, StrTrim, StrUpcase, }; pub(crate) use sum::Sum; #[allow(unused_imports)] diff --git a/crates/nu-cli/src/commands/str_/mod.rs b/crates/nu-cli/src/commands/str_/mod.rs index ea7f643353..66f7c61db2 100644 --- a/crates/nu-cli/src/commands/str_/mod.rs +++ b/crates/nu-cli/src/commands/str_/mod.rs @@ -5,7 +5,7 @@ mod find_replace; mod set; mod substring; mod to_datetime; -mod to_float; +mod to_decimal; mod to_integer; mod trim; mod upcase; @@ -17,7 +17,7 @@ pub use find_replace::SubCommand as StrFindReplace; pub use set::SubCommand as StrSet; pub use substring::SubCommand as StrSubstring; pub use to_datetime::SubCommand as StrToDatetime; -pub use to_float::SubCommand as StrToFloat; +pub use to_decimal::SubCommand as StrToDecimal; pub use to_integer::SubCommand as StrToInteger; pub use trim::SubCommand as StrTrim; pub use upcase::SubCommand as StrUpcase; diff --git a/crates/nu-cli/src/commands/str_/to_float.rs b/crates/nu-cli/src/commands/str_/to_decimal.rs similarity index 92% rename from crates/nu-cli/src/commands/str_/to_float.rs rename to crates/nu-cli/src/commands/str_/to_decimal.rs index 949e935b76..a101b723a1 100644 --- a/crates/nu-cli/src/commands/str_/to_float.rs +++ b/crates/nu-cli/src/commands/str_/to_decimal.rs @@ -21,18 +21,18 @@ pub struct SubCommand; #[async_trait] impl WholeStreamCommand for SubCommand { fn name(&self) -> &str { - "str to-float" + "str to-decimal" } fn signature(&self) -> Signature { - Signature::build("str to-float").rest( + Signature::build("str to-decimal").rest( SyntaxShape::ColumnPath, - "optionally convert text into float by column paths", + "optionally convert text into decimal by column paths", ) } fn usage(&self) -> &str { - "converts text into float" + "converts text into decimal" } async fn run( @@ -45,8 +45,8 @@ impl WholeStreamCommand for SubCommand { fn examples(&self) -> Vec { vec![Example { - description: "Convert to float", - example: "echo '3.1415' | str to-float", + description: "Convert to decimal", + example: "echo '3.1415' | str to-decimal", result: None, }] } diff --git a/crates/nu-cli/tests/commands/str_.rs b/crates/nu-cli/tests/commands/str_.rs index f4bdb6d10a..e25e5df28f 100644 --- a/crates/nu-cli/tests/commands/str_.rs +++ b/crates/nu-cli/tests/commands/str_.rs @@ -101,13 +101,13 @@ fn converts_to_int() { } #[test] -fn converts_to_float() { +fn converts_to_decimal() { let actual = nu!( cwd: "tests/fixtures/formats", pipeline( r#" echo "3.1, 0.0415" | split row "," - | str to-float + | str to-decimal | sum "# ));