aboutsummaryrefslogtreecommitdiffstats
path: root/volume/volume.go
blob: e634b5d5805616a1f0bddeb5fa7389fb9a2d7577 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package volume

type Volume float32

const (
	CubicCentimetre Volume = 1
	Litre           Volume = 1_000
	CubicMetre      Volume = 1_000_000
	CubicInch       Volume = 16.38706
)

func (v Volume) As(unit Volume) float32 {
	return float32(v / unit)
}