From db590369a8cd064457556e2a96a0b5bd825d1b68 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Wed, 21 Oct 2020 03:26:10 -0400 Subject: [PATCH] Fix filesize "B" regression (#2688) --- crates/nu-data/src/base/shape.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/nu-data/src/base/shape.rs b/crates/nu-data/src/base/shape.rs index ae3f7b06c..fb1e09f9c 100644 --- a/crates/nu-data/src/base/shape.rs +++ b/crates/nu-data/src/base/shape.rs @@ -163,7 +163,7 @@ impl PrettyDebug for FormatInlineShape { .get("filesize_format") .map(|val| val.convert_to_string().to_ascii_lowercase()) .unwrap_or_else(|| "auto".to_string()); - // if there is a value match it to one of the valid values for byte units + // if there is a value, match it to one of the valid values for byte units let filesize_format = match filesize_format_var.as_str() { "b" => (byte_unit::ByteUnit::B, ""), "kb" => (byte_unit::ByteUnit::KB, ""), @@ -194,7 +194,10 @@ impl PrettyDebug for FormatInlineShape { match byte.get_unit() { byte_unit::ByteUnit::B => { let locale_byte = byte.get_value() as u64; - (b::primitive(locale_byte.to_formatted_string(&Locale::en))).group() + (b::primitive(locale_byte.to_formatted_string(&Locale::en)) + + b::space() + + b::kind("B")) + .group() } _ => b::primitive(byte.format(1)), }