code: func formatPct(f float64, div float64) float64 {
  	// avoid division by 0
  	if div == 0 {
  		div = 1
  	}
  	rounded := math.Floor((f / div * 10000) + .5)
  	return math.Max(rounded/100, 0)
  }
docs: // Helper function: derives percentage, rounds to 2dp and sanitises