diff --git a/watchtower/src/main.rs b/watchtower/src/main.rs index d16faebca2..d9b26c8d97 100644 --- a/watchtower/src/main.rs +++ b/watchtower/src/main.rs @@ -241,9 +241,9 @@ fn main() -> Result<(), Box> { .sum(); let total_stake = total_current_stake + total_delinquent_stake; - let current_stake_percent = total_current_stake * 100 / total_stake; + let current_stake_percent = total_current_stake as f64 * 100. / total_stake as f64; info!( - "Current stake: {}% | Total stake: {}, current stake: {}, delinquent: {}", + "Current stake: {:.2}% | Total stake: {}, current stake: {}, delinquent: {}", current_stake_percent, Sol(total_stake), Sol(total_current_stake), @@ -271,10 +271,10 @@ fn main() -> Result<(), Box> { )); } - if config.monitor_active_stake && current_stake_percent < 80 { + if config.monitor_active_stake && current_stake_percent < 80. { failures.push(( "current-stake", - format!("Current stake is {}%", current_stake_percent), + format!("Current stake is {:.2}%", current_stake_percent), )); }