Re: [go-nuts] Re: How concatenate more type of formatting for the same variable (fmt.Printf)

2019-01-22 Thread Michael Jones
Antonio, The first example has three format verbs and just two values. That is usually wrong. Use "go vet" to be warned of such errors. Sam's answer explains how you can print two values three ways using indexing "[1]" and "[2]". Your new example has two format verbs and two values. This is

[go-nuts] Re: How concatenate more type of formatting for the same variable (fmt.Printf)

2019-01-22 Thread Antonio Romeo Riga
Don't work, print 2 time the same variable (coin). The solution is : fmt.Printf("%-15.2f %5.2f\n", coin, piggybank) Now add spaces and format the float variable coin (-15v + 5.2f) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To