Fix build errors.

This commit is contained in:
Kistaro Windrider 2023-11-18 18:05:04 -08:00
parent 2ebc2f904f
commit 91ebe9ddc3
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -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),
} }
} }