From ca0d4f423a7892f582eced971a31caab1add9c02 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 22 Oct 2024 04:26:29 -0500 Subject: experiements Signed-off-by: Jeff Carr --- helpers.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'helpers.go') 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) +} -- cgit v1.2.3