-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathlevel.go
More file actions
35 lines (26 loc) · 887 Bytes
/
level.go
File metadata and controls
35 lines (26 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package meteomatics
import "strconv"
// A LevelString is a string representation of a level.
type LevelString string
// A LevelStringer can be converted to a LevelString.
type LevelStringer interface {
LevelString() LevelString
}
// A LevelCentimeters is level in centimeters.
type LevelCentimeters int
// LevelString returns l as a LevelString.
func (l LevelCentimeters) LevelString() LevelString {
return LevelString(strconv.Itoa(int(l)) + "cm")
}
// A LevelMeters is level in meters.
type LevelMeters int
// LevelString returns l as a LevelString.
func (l LevelMeters) LevelString() LevelString {
return LevelString(strconv.Itoa(int(l)) + "m")
}
// A LevelHectopascals is level in hectopascals.
type LevelHectopascals int
// LevelString returns l as a LevelString.
func (l LevelHectopascals) LevelString() LevelString {
return LevelString(strconv.Itoa(int(l)) + "hPa")
}