summaryrefslogtreecommitdiff
path: root/helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.go')
-rw-r--r--helpers.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/helpers.go b/helpers.go
index 81b5fb2..4148a23 100644
--- a/helpers.go
+++ b/helpers.go
@@ -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)
+}