From 3cf7652e8659cbe096425c767c928e1197d162a2 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Wed, 21 Oct 2020 14:19:35 -0500 Subject: [PATCH] fixed a bug where 'B' wasn't showing up (#2690) right when get_appropriate_unit was called --- crates/nu-data/src/base/shape.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/nu-data/src/base/shape.rs b/crates/nu-data/src/base/shape.rs index fb1e09f9c1..69a1e81f96 100644 --- a/crates/nu-data/src/base/shape.rs +++ b/crates/nu-data/src/base/shape.rs @@ -194,10 +194,12 @@ 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)) - + b::space() - + b::kind("B")) - .group() + let locale_byte_string = locale_byte.to_formatted_string(&Locale::en); + if filesize_format.1 == "auto" { + (b::primitive(locale_byte_string) + b::space() + b::kind("B")).group() + } else { + (b::primitive(locale_byte_string)).group() + } } _ => b::primitive(byte.format(1)), }