Fix build errors.
This commit is contained in:
parent
2ebc2f904f
commit
91ebe9ddc3
@ -1,6 +1,7 @@
|
|||||||
package auctionsim
|
package auctionsim
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ func Summarize(price float64, allBidders []Bidder) *ResultSummary {
|
|||||||
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,
|
||||||
@ -108,7 +109,7 @@ func ResultSummaryCSVHeader() []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func csvFloat(f float64) string {
|
func csvFloat(f float64) string {
|
||||||
return strconv.FormatFloat(f, 'g', CSVPrecision)
|
return strconv.FormatFloat(f, 'g', CSVPrecision, 64)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -121,11 +122,11 @@ func (s *ResultSummary) CSVRecord() []string {
|
|||||||
csvFloat(s.Price),
|
csvFloat(s.Price),
|
||||||
csvFloat(s.WinnerValue),
|
csvFloat(s.WinnerValue),
|
||||||
csvFloat(s.WinnerProfit),
|
csvFloat(s.WinnerProfit),
|
||||||
strconv.Itoa(LosersWithRegrets),
|
strconv.Itoa(s.LosersWithRegrets),
|
||||||
csvFloat(s.HighestValue),
|
csvFloat(s.HighestValue),
|
||||||
csvFloat(s.HighestValuatorBid),
|
csvFloat(s.HighestValuatorBid),
|
||||||
csvFloat(s.MissedProfit),
|
csvFloat(s.MissedProfit),
|
||||||
csvFloat(s.ValueDelta),
|
csvFloat(s.ValueDelta),
|
||||||
strconv.Itoa(HighestValueRank),
|
strconv.Itoa(s.HighestValueRank),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user