// Chapter 14 example: turning numbers into text and text into numbers. // Run with: go run exercises/14/04-text-and-numbers.go package main import ( "fmt" "strconv" ) func main() { level := 7 fmt.Println("Level " + strconv.Itoa(level) + " complete") n, _ := strconv.Atoi("42") fmt.Println(n + 1) // 43 bad, _ := strconv.Atoi("hello") fmt.Println(bad) // 0 x, _ := strconv.ParseFloat("3.14", 64) fmt.Println(x * 2) // 6.28 }