diff options
Diffstat (limited to 'helpers.go')
| -rw-r--r-- | helpers.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1,5 +1,12 @@ package virtbuf -func (x *Hypervisor) SetMemory(gb int) { +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) +} |
