Files
learngo/interfaces/09-stringer/money.go
2019-09-01 22:05:09 +03:00

18 lines
344 B
Go

// For more tutorials: https://blog.learngoprogramming.com
//
// Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
package main
import "fmt"
type money float64
// money satisfies the fmt.Stringer
func (m money) String() string {
return fmt.Sprintf("$%.2f", m)
}