code: func numberRound(number float64, decimals int) string {
  	if number == float64(int64(number)) {
  		return strconv.FormatInt(int64(number), 10)
  	}
  
  	str := fmt.Sprintf("%f", number)
  	pos := strings.Index(str, ".")
  
  	if pos != -1 && len(str) > (pos+decimals) {
  		str = str[0 : pos+decimals+1]
  	}
  
  	backToNum, _ := strconv.ParseFloat(str, 64)
  	difference := number - backToNum
  	half := 0.5
  	for i := 0; i < decimals; i++ {
  		half = half / 10
  	}
  
  	roundUp := false
  	if difference > half {
  		roundUp = true
  	} else if difference == half {
  		// for halfs, round to even
  		lastDigit := str[:len(str)-1]
  		roundUp = lastDigit == "1" || lastDigit == "3" || lastDigit == "5" || lastDigit == "7" || lastDigit == "9"
  	}
  
  	if roundUp {
  		// multiply, then ceil, then divide
  		multiplier := math.Pow(float64(10), float64(decimals))
  		multiplied := strconv.FormatFloat(math.Ceil(number*multiplier), 'f', 0, 64)
  
  		if len(multiplied) > decimals {
  			str = multiplied[:len(multiplied)-decimals] + "." + multiplied[len(multiplied)-decimals:]
  		} else {
  			str = "0." + strings.Repeat("0", decimals-len(multiplied)) + multiplied
  		}
  	}
  
  	str = strings.TrimRight(str, "0")
  	str = strings.TrimRight(str, ".")
  
  	return str
  }
docs: // numberRound takes a number and returns a string containing a rounded to the
  // even with the number of decimal places requested.  If this would result in
  // the right most decimal place(s) containing "0"s, then all "0"s on the end of
  // the decimal portion will be truncated.