package main import "fmt" import "os" import "strconv" var miles float64 const ( MilesToKm float64 = 1.609344 width = 20 titleMiles = "| Miles: " titleKm = "| Km: " ) func main() { if miles, err := strconv.ParseFloat(os.Args[1], 64); err == nil { fmtMiles := strconv.FormatFloat(miles, 'f', 2, 64) fmtKm := strconv.FormatFloat(miles*MilesToKm, 'f', 2, 64) fmt.Println("") fmt.Println("") fmt.Println("
Miles:", fmtMiles, "
") fmt.Println("Kilometers:", fmtKm, "
") fmt.Println(" ") fmt.Println("") } else { panic(err) } }