13 lines
264 B
Go
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) }
|