From bd42e6738d1b7e3e78e261a0f4c6b96cee428bbe Mon Sep 17 00:00:00 2001 From: Erikas Date: Fri, 12 Jul 2024 10:50:09 +0300 Subject: [PATCH] properly store humanized RAM --- benchmark_data.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmark_data.go b/benchmark_data.go index 6b2351a..b35bf28 100644 --- a/benchmark_data.go +++ b/benchmark_data.go @@ -107,10 +107,12 @@ func readMangoHudFile(scanner *bufio.Scanner) (*BenchmarkData, error) { case 3: kilobytes := new(big.Int) _, ok := kilobytes.SetString(strings.TrimSpace(v), 10) - if !ok { + if ok { + // Contains number that represents kilobytes bytes := new(big.Int).Mul(kilobytes, big.NewInt(1024)) benchmarkData.SpecRAM = humanize.Bytes(bytes.Uint64()) } else { + // Contains humanized (or invalid) value, so no conversion needed benchmarkData.SpecRAM = truncateString(strings.TrimSpace(v)) } case 4: