|
6 | 6 | "github.com/jedib0t/go-pretty/v6/text" |
7 | 7 | "github.com/zooper-corp/mooncli/config" |
8 | 8 | "github.com/zooper-corp/mooncli/internal/client" |
9 | | - "math" |
| 9 | + "github.com/zooper-corp/mooncli/internal/tools" |
10 | 10 | "os" |
11 | 11 | ) |
12 | 12 |
|
@@ -78,21 +78,19 @@ func DumpTable(data client.CollatorPool, client *client.Client, options config.T |
78 | 78 | revokeRound := data.RoundNumber + options.RevokeRounds |
79 | 79 | for _, info := range data.Collators { |
80 | 80 | t.AppendRow(table.Row{ |
81 | | - info.DisplayName(), |
| 81 | + tools.ToAscii(info.DisplayName()), |
82 | 82 | info.Rank, |
83 | 83 | info.Selected, |
84 | 84 | // Counted |
85 | | - fmt.Sprintf("%vK", math.Round(info.Counted.Float64()/1000)), |
| 85 | + tools.Humanize(info.Counted.Float64()), |
86 | 86 | // Blocks |
87 | 87 | fmt.Sprintf("%v", info.History[data.RoundNumber].Blocks), |
88 | 88 | fmt.Sprintf("%.1f", info.AverageBlocks()), |
89 | 89 | // Balance |
90 | | - fmt.Sprintf("%v", math.Round(info.Balance.Free.Float64())), |
| 90 | + tools.Humanize(info.Balance.Free.Float64()), |
91 | 91 | // Revokes |
92 | | - fmt.Sprintf("%vK", math.Round(info.RevokeAt(revokeRound).Counted.Float64()/1000)), |
93 | | - fmt.Sprintf("%vK", math.Round( |
94 | | - (info.Counted.Float64()-info.RevokeAt(revokeRound).Counted.Float64())/1000), |
95 | | - ), |
| 92 | + tools.Humanize(info.RevokeAt(revokeRound).Counted.Float64()), |
| 93 | + tools.Humanize(info.Counted.Float64() - info.RevokeAt(revokeRound).Counted.Float64()), |
96 | 94 | fmt.Sprintf("%v", info.Revokes[revokeRound].Rank), |
97 | 95 | }) |
98 | 96 | } |
|
0 commit comments