| Index: milo/appengine/common/funcs.go
|
| diff --git a/milo/appengine/common/funcs.go b/milo/appengine/common/funcs.go
|
| index 805ebeadc536ed3b63c0c54e330fbee212f13998..36855445d18ed29ce6cd47bd5e1bb6d15fbb0cc9 100644
|
| --- a/milo/appengine/common/funcs.go
|
| +++ b/milo/appengine/common/funcs.go
|
| @@ -31,6 +31,7 @@ var funcMap = template.FuncMap{
|
| "consoleHeader": consoleHeader,
|
| "pagedURL": pagedURL,
|
| "formatTime": formatTime,
|
| + "percent": percent,
|
| }
|
|
|
| // localTime returns a <span> element with t in human format
|
| @@ -245,6 +246,12 @@ func pagedURL(r *http.Request, limit int, cursor string) string {
|
| return result.String()
|
| }
|
|
|
| +// percent divides one number by a divisor and returns the percentage in string form.
|
| +func percent(numerator, divisor int) string {
|
| + p := float64(numerator) * 100.0 / float64(divisor)
|
| + return fmt.Sprintf("%.1f", p)
|
| +}
|
| +
|
| func init() {
|
| linkifySetTemplate = template.Must(
|
| template.New("linkifySet").
|
|
|