Skip to content

Commit

Permalink
Shorten names in pie chart report
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Dec 4, 2016
1 parent 15a737d commit 1fb6571
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 65 deletions.
17 changes: 17 additions & 0 deletions cmd/lweb/abbrev.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package main

import (
"strings"

"github.com/juztin/numeronym"
)

func abbrev(acctName string) string {
accounts := strings.Split(acctName, ":")
shortAccounts := make([]string, len(accounts))
for i := range accounts[:len(accounts)-1] {
shortAccounts[i] = string(numeronym.Parse([]byte(accounts[i])))
}
shortAccounts[len(accounts)-1] = accounts[len(accounts)-1]
return strings.Join(shortAccounts, ":")
}
Loading

0 comments on commit 1fb6571

Please sign in to comment.