Repository: nushell/nushell
File: crates/nu-cmd-extra/src/extra/strings/format/number.rs (Rust)

Code before:
use nu_cmd_base::input_handler::{CellPathOnlyArgs, operate};
use nu_engine::command_prelude::*;

#[derive(Clone)]
pub struct FormatNumber;

impl Command for FormatNumber {
    fn name(&self) -> &str {
        "format number"
    }

    fn description(&self) -> &str {
        "Format a number."
    }

    fn signature(&self) -> nu_protocol::Signature {
        Signature::build("format number")
            .input_output_types(vec![(Type::Number, Type::record())])
            .switch(
                "no-prefix",
                "don't include the binary, hex and octal prefixes",
                Some('n'),
            )
            .category(Category::Conversions)
    }

    fn search_terms(&self) -> Vec<&str> {
        vec!["display", "render", "fmt"]
    }

    fn examples(&self) -> Vec<Example> {
        vec![
            Example {
                description: "Get a record containing multiple formats for the number 42",
                example: "42 | format number",
                result: Some(Value::test_record(record! {
                        "debug" =>    Value::test_string("42"),
                        "display" =>  Value::test_string("42"),
                        "binary" =>   Value::test_string("0b101010"),
                        "lowerexp" => Value::test_string("4.2e1"),
                        "upperexp" => Value::test_string("4.2E1"),
                        "lowerhex" => Value::test_string("0x2a"),
                        "upperhex" => Value::test_string("0x2A"),
                        "octal" =>    Value::test_string("0o52"),
                })),
            },

Review comment (suggestion):
```suggestion
                "don't include the binary, hex or octal prefixes",
```

Code after:
use nu_cmd_base::input_handler::{CellPathOnlyArgs, operate};
use nu_engine::command_prelude::*;

#[derive(Clone)]
pub struct FormatNumber;

impl Command for FormatNumber {
    fn name(&self) -> &str {
        "format number"
    }

    fn description(&self) -> &str {
        "Format a number."
    }

    fn signature(&self) -> nu_protocol::Signature {
        Signature::build("format number")
            .input_output_types(vec![(Type::Number, Type::record())])
            .switch(
                "no-prefix",
                "don't include the binary, hex or octal prefixes",
                Some('n'),
            )
            .category(Category::Conversions)
    }

    fn search_terms(&self) -> Vec<&str> {
        vec!["display", "render", "fmt"]
    }

    fn examples(&self) -> Vec<Example> {
        vec![
            Example {
                description: "Get a record containing multiple formats for the number 42",
                example: "42 | format number",
                result: Some(Value::test_record(record! {
                        "debug" =>    Value::test_string("42"),
                        "display" =>  Value::test_string("42"),
                        "binary" =>   Value::test_string("0b101010"),
                        "lowerexp" => Value::test_string("4.2e1"),
                        "upperexp" => Value::test_string("4.2E1"),
                        "lowerhex" => Value::test_string("0x2a"),
                        "upperhex" => Value::test_string("0x2A"),
                        "octal" =>    Value::test_string("0o52"),
                })),
            },