From 60b1b1e0f65ee2501e4f1f9896b459adc90ff77c Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Tue, 28 May 2019 10:32:45 -0700 Subject: [PATCH] Fix localization issues on macOS (#124) --- src/widgets/proc_other.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/proc_other.go b/src/widgets/proc_other.go index a4aedf09..6e7c6a80 100644 --- a/src/widgets/proc_other.go +++ b/src/widgets/proc_other.go @@ -8,6 +8,8 @@ import ( "os/exec" "strconv" "strings" + + "github.com/cjbassi/gotop/src/utils" ) const ( @@ -33,11 +35,11 @@ func getProcs() ([]Proc, error) { if err != nil { log.Printf("failed to convert first field to int: %v. split: %v", err, line) } - cpu, err := strconv.ParseFloat(strings.TrimSpace(line[63:68]), 64) + cpu, err := strconv.ParseFloat(utils.ConvertLocalizedString(strings.TrimSpace(line[63:68])), 64) if err != nil { log.Printf("failed to convert third field to float: %v. split: %v", err, line) } - mem, err := strconv.ParseFloat(strings.TrimSpace(line[69:74]), 64) + mem, err := strconv.ParseFloat(utils.ConvertLocalizedString(strings.TrimSpace(line[69:74])), 64) if err != nil { log.Printf("failed to convert fourth field to float: %v. split: %v", err, line) }