mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
unit: add Value.Scale method
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user