Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
Fix localization issues on macOS (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbassi committed May 28, 2019
1 parent d2ca3b6 commit 60b1b1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/widgets/proc_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"os/exec"
"strconv"
"strings"

"github.com/cjbassi/gotop/src/utils"
)

const (
Expand All @@ -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)
}
Expand Down

0 comments on commit 60b1b1e

Please sign in to comment.