~eliasnaur/gio

607d853b58a68c32cff7b8768c45f288e7e08c93 — Elias Naur 1 year, 1 month ago d829e56
unit: add Value.Scale method

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 6 insertions(+), 0 deletions(-)

M unit/unit.go
M unit/unit.go => unit/unit.go +6 -0
@@ 66,6 66,12 @@ func Sp(v float32) Value {
	return Value{V: v, U: UnitSp}
}

// Scale returns the value scaled by s.
func (v Value) Scale(s float32) Value {
	v.V *= s
	return v
}

func (v Value) String() string {
	return fmt.Sprintf("%g%s", v.V, v.U)
}