add: money type to interfaces
This commit is contained in:
@ -11,9 +11,9 @@ import "fmt"
|
||||
|
||||
type puzzle struct {
|
||||
title string
|
||||
price float64
|
||||
price money
|
||||
}
|
||||
|
||||
func (p puzzle) print() {
|
||||
fmt.Printf("%-15s: $%.2f \n", p.title, p.price)
|
||||
fmt.Printf("%-15s: %s\n", p.title, p.price.string())
|
||||
}
|
||||
|
Reference in New Issue
Block a user