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 almost always right. On Tue, Jan 22, 2019 at 5:21 AM Antonio Romeo Riga < [email protected]> wrote: > 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 unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- *Michael T. [email protected] <[email protected]>* -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
