fix:a bug of the power percentage in lotus-storage-miner info

This commit is contained in:
Yang 2020-01-30 15:02:50 +08:00
parent 7f9a3ac584
commit e5a48800ab

View File

@ -50,8 +50,8 @@ var infoCmd = &cli.Command{
return err return err
} }
percI := types.BigDiv(types.BigMul(pow.MinerPower, types.NewInt(1000)), pow.TotalPower) percI := types.BigDiv(types.BigMul(pow.MinerPower, types.NewInt(1000000)), pow.TotalPower)
fmt.Printf("Power: %s / %s (%0.4f%%)\n", pow.MinerPower.SizeStr(), pow.TotalPower.SizeStr(), float64(percI.Int64())/100000*10000) fmt.Printf("Power: %s / %s (%0.4f%%)\n", pow.MinerPower.SizeStr(), pow.TotalPower.SizeStr(), float64(percI.Int64())/10000)
secCounts, err := api.StateMinerSectorCount(ctx, maddr, nil) secCounts, err := api.StateMinerSectorCount(ctx, maddr, nil)
if err != nil { if err != nil {