1
0
mirror of https://github.com/thebaer/tildes.git synced 2018-07-20 07:15:21 +00:00

Move "Last Amt." column to end

This commit is contained in:
Matt Baer 2015-01-31 21:42:33 -05:00
parent c0c1ccf233
commit 23a084d74c

View File

@ -33,7 +33,7 @@ func main() {
scoresPath = "/home/bear/tildescores.txt" scoresPath = "/home/bear/tildescores.txt"
} }
headers := []string{ "User", "Tildes", "Last Collected", "Last Amt.", "# Asks", "Avg." } headers := []string{ "User", "Tildes", "Last Collected", "# Asks", "Avg.", "Last Amt." }
scoresData := readData(scoresPath, "&^%") scoresData := readData(scoresPath, "&^%")
updatesData := readData(scoreDeltasPath, deltaDelimiter) updatesData := readData(scoreDeltasPath, deltaDelimiter)
@ -148,14 +148,6 @@ func checkScoreDelta(scoreRows *[]Row, deltaRows *[]Row) *[]Row {
u.Times++ u.Times++
} }
var lastIncStr string
if u.LastIncrement > -1 {
lastIncStr = strconv.Itoa(u.LastIncrement)
} else {
lastIncStr = "-"
}
r.Data = append(r.Data, lastIncStr)
var asksStr string var asksStr string
if u.Times > 0 { if u.Times > 0 {
asksStr = strconv.Itoa(u.Times) asksStr = strconv.Itoa(u.Times)
@ -173,6 +165,14 @@ func checkScoreDelta(scoreRows *[]Row, deltaRows *[]Row) *[]Row {
} }
r.Data = append(r.Data, avgStr) r.Data = append(r.Data, avgStr)
var lastIncStr string
if u.LastIncrement > -1 {
lastIncStr = strconv.Itoa(u.LastIncrement)
} else {
lastIncStr = "-"
}
r.Data = append(r.Data, lastIncStr)
users[r.Data[0]] = u users[r.Data[0]] = u
(*scoreRows)[i] = r (*scoreRows)[i] = r
} }