From 785c799cfb57b186acbf6a7bf6c4cbd2b038daeb Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sun, 16 Sep 2012 22:36:47 -0700 Subject: [PATCH] Only print two significant figures for arms costs --- planeteer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/planeteer.go b/planeteer.go index 71a85dc..c17496d 100644 --- a/planeteer.go +++ b/planeteer.go @@ -633,14 +633,14 @@ func FighterAndShieldCost(data planet_data, dims LogicalIndex, table []State, be final_state[BuyFighters] = 0 alt_best := FindBestState(data, dims, table, final_state) cost := table[alt_best].value - table[best].value - fmt.Println("\rDrones were", float64(cost)/float64(*drones), "each") + fmt.Printf("\rDrones were %.2f each\n", float64(cost)/float64(*drones)) } if *batteries > 0 { final_state := FinalState(dims) final_state[BuyShields] = 0 alt_best := FindBestState(data, dims, table, final_state) cost := table[alt_best].value - table[best].value - fmt.Println("\rBatteries were", float64(cost)/float64(*batteries), "each") + fmt.Printf("\rBatteries were %.2f each\n", float64(cost)/float64(*batteries)) } } -- 2.44.1