shad-go/lectures/01-basics/tempconv/tempconv.go
2020-02-20 17:40:51 +03:00

13 lines
264 B
Go

package tempconv
import "fmt"
type Celsius float64
type Fahrenheit float64
const (
AbsoluteZeroC Celsius = -273.15
)
func (c Celsius) String() string { return fmt.Sprintf("%g°C", c) }
func (f Fahrenheit) String() string { return fmt.Sprintf("%g°F", f) }