diff --git a/cli-output/src/cli_output.rs b/cli-output/src/cli_output.rs index e592e3abfc..6ef3d893f8 100644 --- a/cli-output/src/cli_output.rs +++ b/cli-output/src/cli_output.rs @@ -393,19 +393,19 @@ impl fmt::Display for CliValidators { ) -> fmt::Result { fn non_zero_or_dash(v: u64, max_v: u64) -> String { if v == 0 { - "- ".into() + " - ".into() } else if v == max_v { - format!("{:>8} ( 0)", v) + format!("{:>9} ( 0)", v) } else if v > max_v.saturating_sub(100) { - format!("{:>8} ({:>3})", v, -(max_v.saturating_sub(v) as isize)) + format!("{:>9} ({:>3})", v, -(max_v.saturating_sub(v) as isize)) } else { - format!("{:>8} ", v) + format!("{:>9} ", v) } } writeln!( f, - "{} {:<44} {:<44} {:>3}% {:>14} {:>14} {:>7} {:>8} {:>7} {}", + "{} {:<44} {:<44} {:>3}% {:>14} {:>14} {:>7} {:>8} {:>7} {:>22} ({:.2}%)", if validator.delinquent { WARNING.to_string() } else { @@ -419,19 +419,19 @@ impl fmt::Display for CliValidators { if let Some(skip_rate) = validator.skip_rate { format!("{:.2}%", skip_rate) } else { - "- ".to_string() + "- ".to_string() }, validator.epoch_credits, validator.version, - if validator.activated_stake > 0 { - format!( - "{} ({:.2}%)", - build_balance_message(validator.activated_stake, use_lamports_unit, true), - 100. * validator.activated_stake as f64 / total_active_stake as f64, - ) - } else { - "-".into() - }, + build_balance_message_with_config( + validator.activated_stake, + &BuildBalanceMessageConfig { + use_lamports_unit, + trim_trailing_zeros: false, + ..BuildBalanceMessageConfig::default() + } + ), + 100. * validator.activated_stake as f64 / total_active_stake as f64, ) } @@ -441,13 +441,13 @@ impl fmt::Display for CliValidators { 0 }; let header = style(format!( - "{:padding$} {:<44} {:<38} {} {} {} {} {} {} {}", + "{:padding$} {:<44} {:<38} {} {} {} {} {} {} {}", " ", "Identity", "Vote Account", "Commission", - "Last Vote ", - "Root Slot ", + "Last Vote ", + "Root Slot ", "Skip Rate", "Credits", "Version",