aboutsummaryrefslogtreecommitdiffstats
path: root/pressure/pressure.go
blob: 820a8cfc070a3b55f1c1d3682abb4aac6ad79b2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package pressure

type Pressure float32

const (
	Pascal              Pressure = 1
	Kilopascal          Pressure = 1_000
	Bar                 Pressure = 100_000
	PoundsPerSquareInch Pressure = 6_894.757
)

func (p Pressure) As(unit Pressure) float32 {
	return float32(p / unit)
}

const Atmospheric = Bar