summaryrefslogtreecommitdiff
path: root/helpers.go
blob: 4148a236926a901603f1936c16013ed02898b4e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
package virtbuf

import "fmt"

func (x *Hypervisor) SetMemoryGB(gb int) {
	x.Memory = int64(gb * 1024 * 1024 * 1024)
}

func (x *Hypervisor) GetMemoryPrintable() string {
	i := x.Memory / (1024 * 1024 * 1024)
	return fmt.Sprintf("%d GB", i)
}