summaryrefslogtreecommitdiffstats
path: root/modules/templates/helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r--modules/templates/helper.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index e4107dfa9a..e1c5d5d86b 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -208,6 +208,9 @@ func NewFuncMap() []template.FuncMap {
}
return path
},
+ "DiffStatsWidth": func(adds int, dels int) string {
+ return fmt.Sprintf("%f", float64(adds)/(float64(adds)+float64(dels))*100)
+ },
"Json": func(in interface{}) string {
out, err := json.Marshal(in)
if err != nil {