format summary.go
This commit is contained in:
parent
b83a3ed5c3
commit
2ebc2f904f
@ -69,22 +69,22 @@ func Summarize(price float64, allBidders []Bidder) *ResultSummary {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
winner := allBidders[len(allBidders) - 1]
|
winner := allBidders[len(allBidders)-1]
|
||||||
rube := Bidder{}
|
rube := Bidder{}
|
||||||
if maxIdx >= 0 {
|
if maxIdx >= 0 {
|
||||||
rube = allBidders[maxIdx]
|
rube = allBidders[maxIdx]
|
||||||
}
|
}
|
||||||
return &ResultSummary {
|
return &ResultSummary{
|
||||||
Bidders: len(allbidders),
|
Bidders: len(allbidders),
|
||||||
Price: price,
|
Price: price,
|
||||||
WinnerValue: winner.Value,
|
WinnerValue: winner.Value,
|
||||||
WinnerProfit: winner.Value - price,
|
WinnerProfit: winner.Value - price,
|
||||||
LosersWithRegrets: regrets,
|
LosersWithRegrets: regrets,
|
||||||
HighestValue: maxValue,
|
HighestValue: maxValue,
|
||||||
HighestValuatorBid: rube.BidCeiling(),
|
HighestValuatorBid: rube.BidCeiling(),
|
||||||
MissedProfit: rube.Value - price,
|
MissedProfit: rube.Value - price,
|
||||||
ValueDelta: maxValue - winner.Value,
|
ValueDelta: maxValue - winner.Value,
|
||||||
HighestValueRank: len(allBidders) - maxIdx,
|
HighestValueRank: len(allBidders) - maxIdx,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user